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

Re: first adventures

On Sat, 01 Nov 2014 13:24:52 -0700
Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> > If you want text not to be processed by the shell, the best way of doing
> > that is to pass it via standard input and output rather than the command
> > line, using "read -r" and "print -r".
> Can you give me an example of that, please?

It doesn't really fit in the case you're looking at.

The point was more that if you had the choice, which you don't, and you
had to pass raw chunks of text around you'd do things like

read -r line < input
print -r -- $line > output

and not actually worry about what was in $line at all.

Perhapse the real point is what you're looking at is an unusual case in
that you've been passed a piece of raw shell input and you're thinking
about what it would look like if it wasn't raw any more.  This is hairy
stuff that most people who consider themselves shell language gurus
probably never have to think about --- extracting bits of semi-parsed
chunks of input is something most people would do in a language like
Lisp rather than a shell.  So it's not surprising you're a bit
bamboozled when you're coming to this out of nowhere.


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