Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • You end up trying to read the memory of whatever $pid is. As I explain in my answer, reading the memory of a different process requires you to ptrace it. Commented Jan 24, 2011 at 19:35
  • 1
    Which is going to be bash. I wasn't saying your answer was wrong. I was just answering in more layman's terms "why doesn't this work". Commented Jan 24, 2011 at 21:07
  • @bahamat: Are you thinking of $$ when you write (and read) $pid? Commented Jan 31, 2011 at 22:22
  • Yes...he started out asking referring to $$ and put $pid at the end. I transposed it in my head without realizing it. My entire answer should refer to $$, not $pid. Commented Jan 31, 2011 at 22:44
  • 1
    @Giles: That's why I put "Since non-privileged processes can only read their own memory space this gets denied by the kernel". (And nope, I didn't realize that until just now when you pointed it out. I thought this whole time I was trying to make it a little more clear to someone else. I don't usually look at the poster's name or rep...then again I'm new here. It makes more sense to me now why the conversation went the way it did.) Commented Feb 1, 2011 at 0:00