When I want to know that process has been spawned by bash, I just check ps. But I was wondering, sometimes I launch things as
for x in $(somecomplextask.sh); do foo $x; done
I wonder, is it possible to check somewhere for the complete line with the for loop. I have the file descriptor in /proc/.../fd/0, but I do not know if I can use some tool to examine it, or perhaps even the content is not anymore, as bash has already read the line. And it is not written in bash_history yet.
Still, I thought it was interesting to ask.
set -x
is what you are looking for