rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* (much) more help on quoting
@ 1991-08-28 14:22 malte
  1991-08-28 17:48 ` John Mackin
  0 siblings, 1 reply; 2+ messages in thread
From: malte @ 1991-08-28 14:22 UTC (permalink / raw)
  To: rc

Ok, once again. I already received some answers to may request for help
on quoting. I assumed that my /bin/sh example was easy to understand.
So, a little more detailed:

	prg -sample "`cat file`"	(sh)

calls prg with _2_ arguments, "-sample", "the contents of file".
The second argument is a bytewise copy of files contents.

What I already have tried (rc):

	prg -sample '`{ cat file }'

doesn't execute `{ cat file }, as expected.

	prg -sample ''`{ cat file }''

gives all the words in file as single arguments to prg with leading and
trailing null strings, as expected.

	prg -sample '''`{ cat file }'''

as above, but leading and trailing "'"s. Adding more quotes adds more null
strings or "'"s, as expected. Applying eval to these lines just shifts
the quoting problem.

	prg -sample (`{ cat file })

Well, I not sure about that. Fact is, that each word in file is a single
argument.

	tmp=`{ cat file }
	prg -sample $^tmp

This passes the contents of file as a single argument, but applies $ifs,
drops "\n" and other control characters, in short, doesn't leave file
untouched.


I hope this makes it clear, especially for those who answered in an
insulting style.

Malte



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-08-28 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-28 14:22 (much) more help on quoting malte
1991-08-28 17:48 ` John Mackin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).