Re: Shell Script (If and Else) problem
Louie;
Hmm. I usually run kshell, so this might not be correct.
You need a then after the first if.
you need [[ ]] not just one bracket.
At 03:23 PM 12/1/2005 +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
>""
>
>""
>""
>""
>
>
>> /Users/JS/Documents/Scripts/XML_CHECK`
>CAT_XML_CHECK=`cat /Users/JS/Documents/Scripts/XML_CHECK`
>
># this must run every 30 minutes
># with or without the network share
>
>"http://192.168.10.7/onlinev2/xmlApp/generateXML.php"
>
>"""" ]
>""
>
>
>fi
>
>"" ]
> 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
>""
>""
>myemail@example.com< email_noshare
>fi
>
>--
>Louie Miranda
>http://www.axishift.com -- under development
RbtBotL
Craig - ><>
o BU SysAdmin
/|\ 607 777 6827
^ Tot Ziens
Reply to: