| Author |
shell script question
|
Kerry Wilson
Ranch Hand
Joined: Oct 29, 2003
Posts: 251
|
|
Want to monitor tomcat shutdown with the following script. However, it is returning '[: too many arguments]'. It works without the '-a $cnt -gt 0' part, but I don't want it to hang indefinitely.
|
http://www.goodercode.com
SCJP 1.4
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
|
Am I missing something here? Without the countdown it shouldn't be hanging indefinitely, it should be looping forever.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Kerry Wilson
Ranch Hand
Joined: Oct 29, 2003
Posts: 251
|
|
Tim Holloway wrote:Am I missing something here? Without the countdown it shouldn't be hanging indefinitely, it should be looping forever.
yea, I don't want it to loop forever. Just can't figure out why the -a {condition} is not working properly.
|
 |
Andrew Monkhouse
author and jackaroo
Marshal Commander
Joined: Mar 28, 2003
Posts: 10824
|
|
I would probably change to compound test commands rather than builtin test commands - just because I find it easier to work with. So something like:
|
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
|
There may be an operator precedence issue. Try putting the "-z ps" clause in parentheses.
|
 |
Kerry Wilson
Ranch Hand
Joined: Oct 29, 2003
Posts: 251
|
|
Thanks for the help, here is what finally worked...
|
 |
 |
|
|
subject: shell script question
|
|
|