This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

shell script question

 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18166
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I missing something here? Without the countdown it shouldn't be hanging indefinitely, it should be looping forever.
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11881
196
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18166
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be an operator precedence issue. Try putting the "-z ps" clause in parentheses.
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help, here is what finally worked...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic