LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-20-2012, 06:37 PM   #1
bilbonix
LQ Newbie
 
Registered: Nov 2012
Posts: 21

Rep: Reputation: Disabled
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
 
Old 11-20-2012, 06:50 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU usage low in top, even though one process is using 80-90% of the CPU mwburden Linux - Software 6 10-23-2012 05:22 PM
grab cpu grabber (non-interactive cpu and process monitor) ezekieldas Linux - Software 8 06-18-2011 03:20 PM
change to higer resolution taydu3000 Mandriva 2 03-29-2006 04:23 PM
RH9 on Toshiba A10 - Cant go higer than 800x600 safetyboy Linux - Laptop and Netbook 12 11-23-2003 07:01 PM
LEI 6.5 installation on Linux 7.3 or higer goel_pankaj Linux - Software 0 11-05-2003 05:55 AM


All times are GMT -5. The time now is 05:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration