![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Gentoo Gentoo Linux is a versatile and fast, completely free Linux distribution geared towards developers and network professionals. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help- To learn shell scripting | tj23 | Shell Programming and Scripting | 2 | 06-20-2008 07:10 AM |
| newbie: way to learn more about server's resource usage | blakekr | UNIX for Dummies Questions & Answers | 2 | 05-20-2008 12:43 AM |
| Hard disk usage is 100% Busy for any command | npcrao | AIX | 3 | 11-14-2007 06:18 AM |
| Programming/Scripting Languages To Learn | tjinr | UNIX for Dummies Questions & Answers | 1 | 07-24-2006 01:32 PM |
| What is a good place to learn basic shell scripting? Thanks! | deutchap6verse5 | Shell Programming and Scripting | 2 | 03-08-2005 02:55 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
cpu%/mem% usage, scripting, dzen2: howto learn bash the hard way
I am trying to write a small (and rather simple) script to gather some info about the system and piping it to dzen2
first, i want to explain some things. I know i could have used conky, but my intention was to expand my knowledge of bash, pipes and redirections inside a script, and to have fun (which i am) some time later, i also decided to try to be more strict on the resource usage. this is a script that will constantly run on a low-end laptop. also, dzen is not the important part of the script and can be simple ignored, is just a way to show the info. if you are interested in dzen, you can read more info here gotmor - dzen so, lets talk about the script itself i use top in batch mode to get the list of most cpu/mem using, but now, i would like to include the total too. (in percentage) with the memory, i was thinking maybe using free, and doing some math on the used/cached fields. but that would involve a new app to run, when top already gave me the info. but taking the info from top's output will require a heavy use of pipes and secondary apps like tail and head with the cpu%, well, im lost ..... where could i find that info? im thinking, maybe is better to just use the iddle% field of top this is what i have done so far general pastebin - broli - post number 1091305 any suggestion on how to improve what i have done will also be welcomed |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|