groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] What does 'groff <<<foo' do?


From: Clarke Echols
Subject: Re: [Groff] What does 'groff <<<foo' do?
Date: Sun, 02 Dec 2012 18:34:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

On 12/02/2012 12:19 PM, Dave Kemper wrote:
'cat <<<foo' or 'cat <<< foo' seems to be a way of passing
what follows the "<<<" directly to the command, as if equivalent
to "echo foo | cat".

Yes.  It's documented in the bash man page under "Here Strings".  I just
learned about it from Ralph's email myself.  It's a great shortcut.



Aha!  I now recall "Here Documents" from my HP days, but they were
handled with something like <<@EOF@, as I recall.  The Korn Shell
manual from AT&T by Korn and his Bell Labs cohort uses a different
character.

I don't remember for sure, but it seems the usage was something
on the order of:

...
cat <<@EOF@ >file
Text line 1
Text line 2
EOF
...

or something similar.  Unfortunately, I don't have any of that old
stuff (from the 1980s) still around for reference.

I've never heard of "here strings" before, but it makes sense --
though a better explanation in the man page would be helpful.

Maybe there's a tuturial manual somewhere...

Indeed there are several:
http://tldp.org/LDP/abs/html/here-docs.html

A Google search on "bash shell script here document" produces plenty
of others.

Thanks for the enlightenment.

Clarke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]