What is the ! mean in an cron scripts I have seen it in if statements, echo statements,
if [[ ! -a $file || ! -s $file ]]
tbasic <<!EOF! >> $TXTFILE
SDS_JOBS=`cat $data/start.dat | grep -v "!" | wc -l`
haubi 060001CR9T37 Posts
Re: ! in if statements2012-06-20T06:44:08ZThis is the accepted answer. This is the accepted answer.There is no such thing like "cron scripts", they are pure (korn-)shell scripts, eventually started by cron.
For the syntax of korn-shell scripts, try "man ksh93".
> if [[ ! -a $file || ! -s $file ]]
Here it is the "not" operator, to be read as "if not exists $file or not exists-and-has-size-greater-than-zero $file".
> tbasic <<!EOF! >> $TXTFILE
Here it doesn't have any special meaning, it is part of the token "!EOF!" defined to mark the end of inlined text used as stdin for 'tbasic' command.
> SDS_JOBS=`cat $data/start.dat | grep -v "!" | wc -l`
Again no special meaning: SDS_JOBS contains the numer of lines in start.dat not containing "!".