bash4, here-documents, <<-EOF ... indented EOF terminator errors out.
Bug #1715023 reported by
Andrej Ricnik
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This snippet, taken from /etc/bash.bashrc, errors out on the here document, even though the
man page states that <<-EOF should allow for the terminating EOF to be indented.
#!/bin/bash
# sudo hint
if [ ! -e "$HOME/
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
Error message is:
./test.sh: line 13: warning: here-document at line 6 delimited by end-of-file (wanted `EOF')
./test.sh: line 14: syntax error: unexpected end of file
To post a comment you must log in.
Stripping whitepsace in front of the EOF on line 9 makes the error go away.