For the following tiny expect script for which a function was added to the bash profile:
chai() {
expect <<- EOF
spawn ssh myuser@myserver
I would normally expect the heredoc terminator (EOF) to be at the start of the line e.g.
chai() {
expect <<- EOF
spawn ssh myuser@myserver
expect ': $'
send 'mypassword\r'
EOF
}
I see you're using <<-
and from the linked doc:
The - option to mark a here document limit string (<<-LimitString) suppresses leading tabs (but not spaces) in the output. This may be useful in making a script more readable.
so you should check the script to see if you have a TAB
preceding your commands. The EOF is subject to the same rules.
cat <<-ENDOFMESSAGE
This is line 1 of the message.
This is line 2 of the message.
This is line 3 of the message.
This is line 4 of the message.
This is the last line of the message.
ENDOFMESSAGE
# The output of the script will be flush left.
# Leading tab in each line will not show.