Can you explain what this script means?
2<<< hello <&2 cat
If I run this shell script, it spits hello. But cannot understand what it means.
Can you please explain one by one?
Many thanks.
CodePudding user response:
see https://www.gnu.org/software/bash/manual/bash.html 3.6.7 and 3.6.8
2<<< hello
puts a stringhello
to stderr;<&2
redirect stderr to stdincat
is a program which receive the stringhello
from stdin and print out