Why can't we direct these outputs into the file after route with Pipe?
You can understand much better what i mean by the example. In my example, why can't I route output with only the routing operator(">
") without using the cat
command?
With cat
command:
└─$ whoami | cat > out.txt
└─$ cat out.txt
testter
Without cat
command:
└─$ whoami | > out1.txt
└─$ cat out1.txt
#no any content in file..
└─$ whoami | >> out2.txt
└─$ cat out2.txt
#no any content in file..
I could also use an alternative tool instead of the cat
command. It's not the cat
tool that's important here. What I want to ask is why can't we route data coming directly from the pipe with the routing operator ">
"?
whoami > file
, right?