Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error at line 2 : `if' unmatched 2

Status
Not open for further replies.

tekinfarmland

Technical User
May 22, 2002
20
0
0
US
I am using ksh on a SunOS machine. I cannot figure out why I am receiving this "if" error.

SYTIME="10:30"
if [ -n "$QETIME" ]; then
JEND=$SYTIME
fi
echo QETIME:$QETIME
echo JEND:$JEND
 
did you mean changing it like this?
if [[ -n "$QETIME" ]]; then
because that did not work either. same error.
 
Please, post the WHOLE script.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The entire script is posted at the top of the thread. I was answering a specific correction suggested by "ProbablyDown:
 
I tried your script in ksh on Solaris 10 and it works fine.

Have you edited this script on a Windows machine? If so, type this and the rerun it.
Code:
dos2unix scriptname.ksh > scriptname2.ksh
chmod +x scriptname2.ksh
./scriptname2.ksh

That should do it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top