![]() |
shell script error msg
I'm trying to run a shell script on a Linux system and I keep getting an error message: "Syntax error near unexpected token `" The line it's referencing is printf " Site | Pages Hit | Uniqs | " >> $sstWhat in the heck is an unexpected token? The script works fine on a unix box. I've struck out trying to find info about it on google. Thanks SS |
What type of shell script is it? sh, bash, csh,.... (you can see it on the first line of the script)?
Can you post what the script looks like where you get the error and 4-5 lines above that line? |
To me it sounds like you're missing a double quotion mark (")...maybe at the end of a line? ex $sst = "This is my site"; printf "Hello world, ; printf " $sst | You see in the second line there's no " at the end...so the script actually thinks the second line is to display Hello world,; printf Now on line 3 the first quotation mark is considered the end of line for line #2...which then makes the script assume the quote is done and looks for new commands to process...in this case it finds If you want to provide the previous five lines of your script I probably can locate the quote problem |
Here's the first 18 lines: #!/bin/sh serverlist=$1 sst=/web/sites/sitestatstable/index.html" echo > test gt=0 at=0 yt=0 aolt=0 aet=0 sitecount=0 totaluniqs=0 totalpages=0 bgcolor="#999999" #echo " "date" printf "
Powered by vBulletin® Version 3.8.1 |