[NTLUG:Discuss] sh question - extra eyes needed

Stephen Davidson gorky at freenet.carleton.ca
Wed Jun 25 07:03:59 CDT 2003


Fred James wrote:
> Sorry, I am probably just blind but I can not see the error here - any 
> "extra eyes" that would care to comment would be very much appreciated.
> 
> In the snippet below, I am getting the following error:
>      "./SID_hot.sh[75]: syntax error at line 82: "then" unmatched"
> (I have added "(line 82)" at the beginning of line 82 in the snippet)
> 
> [Bourne Shell script snippet]
> Hold=$HOLD
> while read Target Status Space
> do
>      Destination=`echo $Target | cut -f4 -d"/"`
>      Destination=$destDir$Destination
>      if test $Space != $Hold
>      then
>            if test $Hold != $System
> (line 82)   then
>                  sqlplus $USER_NAME/$USER_CODE@$ORACLE_SID << EOF
>                          alter tablespace $Hold end backup;
>                  EOF
>            fi
>            if test $Space != $System
>            then
>                  sqlplus $USER_NAME/$USER_CODE@$ORACLE_SID << EOF
>                          alter tablespace $Hold begin backup;
>                  EOF
>            fi
>            cp $Target $Destination
>            wait
>            gzip $Destination
>            wait
>      fi
> done < $dataTxt
> sqlplus $USER_NAME/$USER_CODE@$ORACLE_SID << EOF
>      alter tablespace $Hold end backup;
> EOF
> [end snippet]
> 
Hi Fred.

In all the scripts on my system, there is a ';' before the then.
Don't know if that is what the issue is here or not.

Regards,
Steve

-- 
Java/J2EE Developer/Integrator
214-724-7741






More information about the Discuss mailing list