Score:0

In linux, is it possible to check stdin to see the line that bash is running?

hm flag

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.

4snok avatar
es flag
I think `set -x` is what you are looking for
hm flag
no, set -x is useful, but I was thinking in the case when the job is running and I want to know the full command it is executing at this point.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.