Hacker News new | ask | show | jobs
by thesh4d0w 2151 days ago
Maybe I'm missing something obvious here but on the one that asks you to get the proc's cmdline, how do the examples know it's pid 42?

Only way I can see to do this would be to echo /proc/* first to see what PID it is, guess it's 42, then go from there, but that violates the "do it in one command" rule at the beginning.

1 comments

I haven't dug into the puzzle very far and it didn't seem to like my experiments, but in bash and zsh `$$` will expand to the shells PID.

Edit: Oh, I see what you mean now. I think it's just that you're expected to see that there's only a handful of PIDs in /proc and just try them each.