Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Adding arbitrary data at the end of a script



On Thu, Feb 17, 2005 at 10:12:56AM +0100, DervishD wrote:
> #!/bin/zsh
> true
> exit 0
> cat << DATA.EOF > /dev/null
> <Text data that contains some '$', backticks, etc.>
> DATA.EOF

You just need single quotes around the DATA.EOF to tell zsh to treat the
data literally:

#!/bin/zsh
true
exit 0
cat << 'DATA.EOF' > /dev/null
<Text data that contains some '$', backticks, etc.>
DATA.EOF

You could drop the ">/dev/null" too, if you wanted (since the line will
never get executed).  You could even substitute another program for
"cat" (such as "true" or "MadeUpNameOfMissingCommand") if you want to
make the line more distinctive.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author