Score:0

terminal input stream behaviour vs output stream

ro flag

I'm new to terminal apps...

When I do

echo "hi" 1> out.txt

I get "hi" written to out.txt

When I do

echiao "hi" 2> out.txt

I get the error message in out.txt

So far so good. But when i do

echo "hi" 0> out.txt

nothing will be written to out.txt. Why? I'd expect that the corresponding stream will be written to the file. I see that its stupid to reroute the input stream. But why not just put a copy into the file?? What am I missing and how would I properly log the input to the command.

David avatar
cn flag
You may want to investigate what 0> does as opposed to 1 and 2.
I sit in a Tesla and translated this thread with Ai:

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.