I have the below if statement. It gives me syntax error when I have both the csv file and the zip file in the folder. But it works when I have the csv file alone or the zip file alone or no files exist.
I'm not sure what causes the syntax error in the command below:
if [ -f ctf_error_report_??_????????????.csv -o -f ctf_error_report_??_????????????.???.zip ]; then echo "Successful" else echo "Problem" fi exit 0 Any insight regarding this?
ksh -x your-scriptto see what gets executed. The chances are that the file name expansion expressions yield more than one file name, as the other people have diagnosed in their answers.