rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* hopefully last letter on sh
@ 1991-08-28 19:28 malte
  0 siblings, 0 replies; only message in thread
From: malte @ 1991-08-28 19:28 UTC (permalink / raw)
  To: rc

Mea culpa, John is right with what he says about terminal \n handling in
sh. The file including the sample is kind of a binary, so therefore it hasn't
got a terminal \n.
But I disagree on your "cat" example. This only prooves that you cannot
decide whether perror(3) on pathnames or sh inside "" strips trailing \ns.
Having read John's letter I tried this (^X is char 030):

	echo "hello ^X there" > test
	od -c tescht

which gives "h   e   l   l   o     030       t   h   e   r   e  \n"

	echo -n "`cat test`" | od -c

responding with "h   e   l   l   o     030       t   h   e   r   e"

Anyway, the result is the same, I just had to have those control chars kept.
And now the final answer for today, which is:
	prg -sample `` () { cat file }

This really works!

To come to an end: I know that my expamples were silly, but there were people
seriously suggesting this, and I wanted to prevent answers of this kind.
And insulting will probably not have been the right word, I meant something
weaker. Sigh, English is not my native language.


Malte



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-08-29 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-28 19:28 hopefully last letter on sh malte

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