Wc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Wc
# 1  
Old 03-15-2005
Wc

One of my test server status command output is :

Setting ulimit -n 512
rmiregistry: up
Application Server: up
Statistics Server: up
Security Server: up
Provision Server: up
tomcat: up
Apache: up
WEB GUI is running well

there are 7 up and 1 well. I need to to check that, if they are less than 7 i need to exit. I tried w/wc

****Web status |wc -l up

but it is failing. I need to put it in a script

Thanks,
Gundu
# 2  
Old 03-15-2005
here's something ugly but this should work ... (change "Web status" to the command or script you need to get the output) ...

Code:
[ `Web status | grep -w up | awk 'END {print NR}'` -lt 7 ] && exit

# 3  
Old 03-15-2005
[ `Web status | grep -wc 'up$'` -lt 7 ] && exit
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question