LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-31-2012, 03:43 AM   #1
nano2
Member
 
Registered: May 2007
Posts: 100

Rep: Reputation: 15
pmap


Hi ,

Have the following code
But have an issue trying to get it to interpret the the while loop
i.e print the total any ideas
Code:
t_awk="awk"
fn "pmap" "bash" "-c 'while ((1));do `pmap @PID@ | grep total | ${t_awk} {'print $2'}`; sleep 1 ; done'" 


fn ()
{

cmd[$cnt]="${1}"
args[cnt]="${2}"
}
 
Old 05-31-2012, 04:36 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
is this code works at all? what is the output?
 
Old 05-31-2012, 04:53 AM   #3
nano2
Member
 
Registered: May 2007
Posts: 100

Original Poster
Rep: Reputation: 15
Yes this is the output for args:


args: -c 'while ((1));do mem=; sleep 1; done'


The issue is that it can interpret what's inside the while loop
[code]
"pmap" "bash" "-c 'while ((1));do mem=`pmap @PID@ | grep total | ${t_awk} {'print $2'}`; sleep 1; done'"
/code]
 
  


Reply

Tags
bash scripting, sed



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pmap vs jmap grob115 Programming 1 06-20-2011 10:35 AM
pmap grob115 Linux - General 9 05-26-2011 06:37 PM
Pmap update fraFFfra Linux - Newbie 3 10-08-2010 04:46 AM
pmap -x available on all linux? amol28kulkarni Linux - Newbie 1 01-24-2009 01:44 AM
pmap for linux doraemona Linux - General 0 05-11-2002 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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