Im trying to do this:
current_size = exec("ps -o rss $(pgrep rake)")
When it runs, I get:
RSS
2784
560
568
788
but the process exits.
Any idea what im doing wrong?
I also tried:
exec("ps -o rss #{Process.pid}")
Same problem
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From “ri Kernel.exec”
Your process has been replaced by the ps process which prints out the data and then exits.
You probably want Kernel.`
Using %x{ } seems like the better option.