When “cat > xx.txt << EOF” is entered on the command line, further input from cmdline goes to file xx.txt until EOF is written. EOF is not a sacred word here, if instead the command was cat > xx.txt << BBB, then cmdline input goes to xx.txt until BBB is written. I don’t know whats the rationale behind ( << end_of_input_sequence)this. Cat man page does not explain much.
I have only seen this in scripts etc.
When cat > xx.txt << EOF is entered on the command line, further input
Share
It’s a feature of the shell, not
cat– that’s why you won’t find it in thecatmanual.It’s known as a “Here document” – see this page of the Advanced Bash-Scripting Guide for some documentation.