Exit from Bash script on error without closing the terminal window

To terminate the script in case of an error, we can use the “-e” option. When a bash script is “sourced”, called from an alias with a leading dot like my-alias=’. /my-script to execute in the same process, or a function is executed from a terminal window and the script exits on an error, it […]

delimited by end-of-file (wanted `EOF’)

When you create a file in a script and use an end of file delimiter, if … cat <<EOF> $chef_dir/attrib.json $json EOF fi and you indent the word EOF to look nicer, you will get the error message warning: here-document at line … delimited by end-of-file (wanted `EOF’) STDERR> …: line …: syntax error: unexpected end of file […]