LinuxQuestions.org
Help answer threads with 0 replies.
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
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,459

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


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 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


All times are GMT -5. The time now is 02:11 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration