Re: How to test if file exists?

2000-08-26 Thread Daniel Pittman
On 26 Aug 2000, Kai Großjohann <[EMAIL PROTECTED]> wrote: > Somebody suggested `ls -d FILE | wc -l'. Maybe with a judicious > `2>/dev/null' thrown in. > > What do you think? Assuming that there isn't an ls out there that spits out the error message onto stdout, rather than stderr, when the fil

Re: How to test if file exists?

2000-08-26 Thread Kai Großjohann
Somebody suggested `ls -d FILE | wc -l'. Maybe with a judicious `2>/dev/null' thrown in. What do you think? kai -- I like BOTH kinds of music.

How to test if file exists?

2000-08-26 Thread Kai Großjohann
I used to use `ls -d FILE; echo $?' to test if a file exists. That, however, fails with NetBSD 1.4 because there the ls program has a bug: it doesn't set the exit status correctly. Therefore, I have now switched to `test -e FILE; echo $?'. And now I find that the Solaris /bin/sh has a test buil