So I am trying to do an if else if else statement in a bash script. As of now when I run this script I get the following error message "./groupJobs.sh: line 76: syntax error near unexpected token elif'
./groupJobs.sh: line 76:elif [ $jobsize -lt $2 ]; then'"
I have looked online at multiple examples and cannot see any difference in what I have done and what others say works.
Any help would be appreciated. (line 76 is the last elif statement)
if [ $filesize -ge $2 ]; then
#goes this way if file is to big to put in a job with anyother files
$filename >> $jobname$jobnumber;
elif [ $jobsize -ge $2 ]; then
#job is done being created
elif [ $jobsize -lt $2 ]; then
#add file to job and move on to next file check
fi
The elif statements need an actual statement. Put something like echo "job creation done" and echo "add file to job" in those statements (or whatever else you want) for the time being...
if [ $filesize -ge $2 ]; then
#goes this way if file is to big to put in a job with anyother files
$filename >> $jobname$jobnumber;
elif [ $jobsize -ge $2 ]; then
#job is done being created
echo "whatever you want"
#the above line just has to be some sort of actual statement
elif [ $jobsize -lt $2 ]; then
#add file to job and move on to next file check
echo "whatever you want"
#the above line just has to be some sort of actual statement
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With