Hi Folks,
Please tell me the unix shell script command to check for the existence of some .done file in a location on the UNIX server.
Using a test with one of these that suits you:
i.e.
if [ -r SomeFile ]; then ...
...
fi
-a file
Same as -e below. This is obsolete.
-b file
True, if file exists and is a block special file.
-c file
True, if file exists and is a character special file.
-d file
True, if file exists and is a directory.
-e file
True, if file exists.
-f file
True, if file exists and is an ordinary file.
-g file
True, if file exists and it has its setgid bit set.
-k file
True, if file exists and it has its sticky bit set.
-p file
True, if file exists and is a fifo special file or a pipe.
-r file
True, if file exists and is readable by current process.
-s file
True, if file exists and has size greater than zero.
-t fildes
True, if file descriptor number fildes is open and associated
with a terminal device.
-u file
True, if file exists and it has its setuid bit set.
-w file
True, if file exists and is writable by current process.
-x file
True, if file exists and is executable by current process. If
file exists and is a directory, then true if the current process
has permission to search in the directory.
-L file
True, if file exists and is a symbolic link.
-h file
True, if file exists and is a symbolic link.
-N file
True, if file exists and the modification time is greater than
the last access time.
-O file
True, if file exists and is owned by the effective user id of
this process.
-G file
True, if file exists and its group matches the effective group
id of this process.
-S file
True, if file exists and is a socket.
file1 -nt file2
True, if file1 exists and file2 does not, or file1 is newer than
file2.
file1 -ot file2
True, if file2 exists and file1 does not, or file1 is older than
file2.
file1 -ef file2
True, if file1 and file2 exist and refer to the same file.
These are for ksh, other shells may vary. Check the man page.