total crap, it doesn't actually test if the file is there or not, it just tests if the command line argument is there. There's a giant f*cking differences.
Adam
I don't think you're using it quite right Young Padawan
ayw
if [ -e testfile ]; tests whether a file exists.
if [ -f testfile ]; only tests whether file is a regular file
David
No. From the man page: " -f filename True if filename exists and is a regular file.""
Third Rook
Regardless what the man page says. -f didn't work in my script, and -e did.
Shouldn't that one have some brackets or something?
Joeblackspirit
Perfect and simple!!
dish
And what to do if I have several files smth.gz but I don't know how much and I don't know actual names. I need to run some command if one of such files exists.