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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 15632
    
  15

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: 11278
    
  59

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: 15632
    
  15

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
Display problem of drop down and div
need counter example
source cod for selection and saving the pdf document
Populating the ComboBox by selecting another
unwrap a buffer