On Thu, Dec 01, 2005 at 03:23:32PM +0800, Louie Miranda wrote: > Im having troubles on my shell script. When i run it, im having this errors. > > ./runXML3.sh: line 18: syntax error near unexpected token `fi' > ./runXML3.sh: line 18: `fi' > > Im a bit confused how to overcome the problem here. I hope somebody knew > what can i do here. > > The Code > > #!/bin/sh -x
I'm assuming you use bash (you don't specify). > (...) > > if [ -d "$XML_NETWORK_SHARE" ] > then > cp $XMLPARSEDFILES/*.xml $XML_FOR_TRANSFER > cp $XMLPARSEDFILES/*.xml $XML_COPY > mv $XMLPARSEDFILES/*.xml $XML_NETWORK_SHARE > else > mv $XMLPARSEDFILES/*.xml $XML_FOR_TRANSFER > echo "no network share, not generating XML files" > mail -s "BCARD V2, no network share - error on XML > FEED" [EMAIL PROTECTED] < email_noshare > fi It should read: if [ ... ]; then command; else other_command; fi (mind the semicolons!) HTH -- Joachim Fahnenmüller -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]