File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes shell script question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "shell script question" Watch "shell script question" New topic
Author

shell script question

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
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: 15960
    
  19

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: 254
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: 11404
    
  81

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: 15960
    
  19

There may be an operator precedence issue. Try putting the "-z ps" clause in parentheses.
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
Thanks for the help, here is what finally worked...

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: shell script question
 
Similar Threads
source cod for selection and saving the pdf document
need counter example
Display problem of drop down and div
Populating the ComboBox by selecting another
unwrap a buffer