LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   If a process cpu % is higer than (https://www.linuxquestions.org/questions/linux-newbie-8/if-a-process-cpu-is-higer-than-4175438030/)

bilbonix 11-20-2012 05:37 PM

If a process cpu % is higer than
 
Is this possible as part of a bigger script to do?

eg:

elif
myprocess.bin cpu% > 12
exit 1
elif
echo below 12

thanks

chrism01 11-20-2012 05:50 PM

Yes & no ;)
You can do if, then, elif, else, fi and put just about any cmd in the gaps between, but that syntax you've got 'myprocess.bin cpu% > 12' isn't valid bash.

You may find these links useful
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/


All times are GMT -5. The time now is 08:05 PM.