Sunday, 18 August 2013

Bash heredoc not working

Bash heredoc not working

I guess this is going to have a simple solution, which is why I'm not
seeing it.
My heredoc syntax is correct, so why does this...
echo<<HH
Usage:
procss [COMMAND]
Commands:
partial - Creates new partial in the working directory
dir - Creates new directory with required partials
HH
...only spit out a newline and leave?
[sage@ed procss]$ _procss_help
[sage@ed procss]$
I even backed out of the script and did it line by line.
[sage@ed procss]$ echo <<END
> Usage:
> procss [COMMAND]
>
> Commands:
> partial - Creates new partial in the working directory
> dir - Creates new directory with required partials
> END
[sage@ed procss]$
Not even this works.
[sage@ed procss]$ echo <<END
> Hello
> World
> END
[sage@ed procss]$
After double checking and triple checking the manual and SO, I'm sure I'm
not being tripped up by common whitespace related mistakes. There is no
trailing whitespace after the opening heredoc line, and no leading
whitespace before the ending line.
What's wrong?

No comments:

Post a Comment