LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   pmap (http://www.linuxquestions.org/questions/linux-general-1/pmap-947719/)

nano2 05-31-2012 04:43 AM

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


pan64 05-31-2012 05:36 AM

is this code works at all? what is the output?

nano2 05-31-2012 05:53 AM

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]


All times are GMT -5. The time now is 08:15 AM.