BASH script error in RH 7.3 ..whaaaa???
if [`grep -c 200 /etc/monitor/java/result` != 0 ]
then echo "Tomcat is up" else echo "Tomcat is down" fi Produces: syntax error: "unexpected end of file" all what this does is grep the file for an occurance of 200 and echo the appropriate string. using #sh -n script.sh produces the same error. any help would be great fellas :confused: |
i can never remember the if then else syntax in bash, try returning after the then and else keywords, or inserting a semi-colom. also in your code you do not have a space between [ and ` which is cruical as well as [ IS a fully blown unix command
|
Yes , as acid_kewpie wrote
The code works fine 4 me, but you need some space between the [ and the ` Code:
|
??
I did not look at the date of the question , Pauly posted this at Jan 2002. I'm sure that he's not intressted anymore :-) |
No he registered on this forum in January. The question got asked today, so I'm sure he will still apreciate the answer.
|
hey, i'm not one of those losers (coughtrickykidcough) that goes to try and find old posts....:)
|
Oh :-)
Should have noticed "Registered: Jan 2002" not not only "Jan 2002".. To early for me , 10:06 AM ZZzzzZZZZzzZZZ |
THanks for the replies....i tried the post that FredrikN posted, and I still get the same error..grrrr...
it has to be something with bash ... thanks guys i apperciated the responses. |
All times are GMT -5. The time now is 03:25 PM. |