3 ms·
Unless you are running the command via "sh -c", you can't see any shell builtin commands or Unix pipelines by dumping the process tree. For example, "cat > /dev
by segfaultbuserr 6y ago
Unless you are running the command via "sh -c", you can't see any shell builtin commands or Unix pipelines by dumping the process tree. For example, "cat > /dev/null", the redirection is done by the shell and isn't passed to cat's "char **argv", in the process tree you can only see a "cat" running without arguments (and a shell built-in is invisible). It also gives no information about the control flow of your one-liner shell script (e.g. what does the "for loop" do?), nor environmental variables, etc. You can try to reconstruct some information by inspecting its open files, its environ, etc., but it's not practical for any complicated combination of commands).