LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 05: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, 05:50 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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 04:22 PM
grab cpu grabber (non-interactive cpu and process monitor) ezekieldas Linux - Software 8 06-18-2011 02:20 PM
change to higer resolution taydu3000 Mandriva 2 03-29-2006 03:23 PM
RH9 on Toshiba A10 - Cant go higer than 800x600 safetyboy Linux - Laptop and Netbook 12 11-23-2003 06:01 PM
LEI 6.5 installation on Linux 7.3 or higer goel_pankaj Linux - Software 0 11-05-2003 04:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:24 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
Open Source Consulting | Domain Registration