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

Re: Adding arbitrary data at the end of a script

    Hi Wayne :)

 * Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx> dixit:
> 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.>
> You just need single quotes around the DATA.EOF to tell zsh to treat the
> data literally

    Wayne, thanks for showing me how utterly stupid I am O:))) I knew
about this feature, but I thought that it was a zsh thing, non
portable. I didn't even look that in SUS. I just looked a moment ago
to make sure it was non portable and SUS specifies just the same :((

    Well, thanks for your help because you're solved my problem. I
didn't even think about using this mechanism O:)

> 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.

    I think that I will substitute it with the name of the file that
must be generated so the filtering in the sed script is easier.

    Thanks a lot, Wayne :)

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...

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