Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple unary operators in an if statement [duplicate]

Is it possible to have multiple unary operators in if statements.. Here is the code snippet which is giving me error.

Please correct the code here.

if [ -f $input_file ] -a [ -f $output_file ] -a [ -f $log_file ] ]
then
    ### Some Code here
fi
like image 721
Kiran Avatar asked Feb 22 '10 09:02

Kiran


1 Answers

if [ -f "file1" -a -f "file2" -a "file3" ]; then
   #some code
fi
like image 200
ghostdog74 Avatar answered Oct 14 '22 13:10

ghostdog74