What is the correct indentation for a bash script? As a java / C ++ monkey, I religiously backtrack my code. But it seems you are not allowed to backtrack this code:
#! /bin/bash
if [ $# = 0 ]
then
echo "there are no parameters"
else
cat << EOF
==========================================================
==========================================================
==========================================================
==========================================================
DESCRIPTION:
$1
----------------------------------------------------------
EOF
fi
When indented, it does not recognize EOF, and if you just did not specify EOF (confusing), it prints indents.
Q: What is the correct indentation for bash scripts?
source
share