I'm trying this to display a default helptext when no parameters are given when executing the script:
if [[ $@ ]]; then
do stuff
else displayHelp;
fi
displayHelp() {
echo "some helptext"
}
But for some reason, when executing the script on console, it says:
./myScript.sh: Line 48: displayHelp: Command not found
The same occurs when I call this function via -h parameter
$#to check their count.