syntax error near unexpected token `else'
Hi i think this is a stupip question too. But I hope than any one can help me to solve it .
./rootb.txt: line 12: syntax error near unexpected token `else ./rootb.txt: line 12: `else #! /bin/bash mkdir /backup_sistem/sistem A="`date | cut -d" " -f3`" if [ "$A" == " " ] ; than date | cut -d" " -f1,2,4,7 > /backup_sistem/.data B="`cut -c1,2,3,5,6,7,9,11,12,13,14 /backup_sistem/.data`" cp -rf /home/* /backup_sistem/sistem/ cd /backup_sistem/ tar -cvf "`echo $B.tar`" /backup_sistem/sistem/* &> /dev/null else date | cut -d" " -f1,2,3,6 > /backup_sistem/.data B="`cut -c1,2,3,5,6,7,9,10,12,13,14,15 /backup_sistem/.data`" cp -rf /home/* /backup_sistem/sistem/ cd /backup_sistem/ tar -cvf "`echo $B.tar`" /backup_sistem/sistem/* &> /dev/null fi rm -rf /backup_sistem/sistem exit best regards jose |
Its 'then' not 'than' after 'if' .
Also when you face a problem in script run it with a '-x' argument.You will come close to the problem. Ex: sh -x one.sh |
Thankz very much zulfilee.
with ur help I had solve the problem. regards jose |
And if you tried to use actual English more (like in spelling and proper grammar)
you may run into less problems coding, too. ;) Cheers, Tink |
All times are GMT -5. The time now is 03:39 AM. |