Hello all,
I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`:
#!/usr/bin/ksh
if [[ -e $HOME/tokenfile ]] then
mailx -s "Token file found! Data files received!" email_address < $HOME/emptyfile
fi
exit
To test it, I touched a file (`tokenfile`) in my $HOME directory, ran my script and got this error
sh: syntax error at line ...: `$HOME/core' unexpected
I declared the file name as a variable
: ${COREFILE:=/$HOME/tokenfile}... [[ -e $COREFILE ]] but got the same error
sh: syntax error at line ...: `$HOME/COREFILE' unexpected
What the @!*%%# (sorry!) am I missing here?? I run this script as the owner of the directory, I have the default `umask` value (not sure if it matters) and I run HP-UX B11.11.
Any help is welcome. I feel like the solution is here: I am just not seeing it.
TIA!!!
Al.