I have a problem with implementing
if
elif ( && ) ||
else
fi
This is the particular code:
#!/bin/bash
EOSDIR=/eos/user/o/user/muonDIS/2-5-SBT
OutputFile53=PositionData_1.txt
OutputFile52=out_1.root
OutputFile51=TotData_1.txt
if test -e "$EOSDIR"/5/"$OutputFile51"; then
echo "File exists and is unbroken. Nothing to do..."
exit 0
elif [[ test -e "$EOSDIR"/5/"$OutputFile52" && [ $(stat -c %s "$EOSDIR"/5/"$OutputFile52") -lt 504 ] ]] || [[ test -e "$EOSDIR"/5/"$OutputFile53" ]]; then
echo "Files are either broken or absent. New files will be generated"
else
echo "Go away"
fi
It says
./t.sh: line 11: conditional binary operator expected ./t.sh: line 11:
syntax error near
-e' ./t.sh: line 11:elif [[ test -e
"$EOSDIR"/5/"$OutputFile52" && [ $(stat -c %s
"$EOSDIR"/5/"$OutputFile52") -lt 504 ] ]] || pp test -e
"$EOSDIR"/5/"$OutputFile53" ]]; then'
[[ortest, not both.