Let\'s assume I have 3 shell scripts:
script_1.sh
#!/bin/bash
./script_3.sh
script_2.sh
Couple of useful files things kept in /proc/$PPID here
/proc/*some_process_id*/exe A symlink to the last executed command under *some_process_id*/proc/*some_process_id*/cmdline A file containing the last executed command under *some_process_id* and null-byte separated argumentsSo a slight simplification.
sed 's/\x0/ /g' "/proc/$PPID/cmdline"