If statement

Hi,

I have a statement in shell script which i am writing below:

if [[ -a $OUTFILE ]]
then
.....

What is the meaning of -a option in files, meaning of the statement in the if condition [[ -a $OUTFILE ]] means.

Thanks

meaning is a syntax error -- :slight_smile: -a is the boolean "and" operator inside square brackets

if [[ <condition a> -a <condition b> ]] ; then ...........

is if condtion a and condition b

No the shell script i have is written like this:

if [[ ! -a $LOG ]]
then
print "$0 started at .... $date" > $LOG
............
fi

after some lines of the above script i saw another similar if condition like:

if [[ -a $OUTFILE ]]
then
rm $OUTFILE
fi

This script with the above statements in it is working perfectly ...........
pl have a look at it & let me know what -a option mean, if it is boolean 'and' is that meaning fits into the above script.

thanks

With the double bracket it is && to "and" two conditions together.
-a file is true if the file exists.