2 ms·
When I read the problem description, I decided to try and solve it myself. I used gcore to dump the running bash process, then ran strings on the core dump, th
by barrkel 12y ago
When I read the problem description, I decided to try and solve it myself.
I used gcore to dump the running bash process, then ran strings on the core dump, then grepped for likely command line stuff. 'while' is reasonable choice for a loop. There aren't that many strings in the dump file in any case, most of the sizeable ones are function definitions and environment variables.
Relying on gdb makes getting to the right data much more precise, but my approach took about 20 seconds.