There is a command I don\'t understand:
custom_command << EOF!!
I want to ask what EOF!! is in the bash script. I did find EOF with googl
On the command line, !!
would be expanded to the last command executed. Bash will print the line for you:
$ ls
a.txt b.txt
$ cat <
In a script, though, history expansion is disabled by default, so the exclamation marks are part of the word.
#! /bin/bash
ls
cat <
Produces:
a.txt b.txt
script.sh: line 7: warning: here-document at line 3 delimited by end-of-file (wanted `EOF!!')
echo 1
EOFls
echo 2
To enable history and history expansion in a script, add the following lines:
set -o history
set -H