rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* A truly revolting feature
@ 1993-07-09  4:54 John Mackin
  0 siblings, 0 replies; only message in thread
From: John Mackin @ 1993-07-09  4:54 UTC (permalink / raw)
  To: The rc Mailing List

I won't name the person whose idea this was since it isn't really his
fault, and my intent isn't to hold _him_ up to ridicule.  Rather it is
to shed light into one of the darkest crannies I have yet seen in the
lexical analyser in /bin/sh, so that we can all feel extra-glad that
we've seen the light and changed to better shells.

Many months ago, I told this man about rc and suggested that he should
take a look at it.  I showed him Duff's document.  He went as far as
building it and putting it in his machine's /usr/local/bin, and giving
it a try.  For some reason, he hasn't changed to rc, but he sent me mail
at the time saying that he was impressed by the ability to mouse the
whole line with the "; " prompt.  I pointed out to him that he could
do that under sh also by using the Pike prompt style (":<anything> ;"),
and then never heard any more from him about it.

The other day I was in his office and he proudly showed me what he'd
come up with: the ability to mouse the whole line _even though PS1
had the standard value of "$ "_.  He had put the following in
$home/bin/ ^ '$':

#!/bin/sh
exec "$@"

Much to my nausea, it turns out that sh is quite prepared to regard
a bare $ sign as a plain old "word", and search the path for it if
it stands in command position...  Of course, this has to be a script
and not a function, since sh's function names have to be "identifer"s.
But, how horrendous can you get?

Yeuch.

OK,
John.


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

only message in thread, other threads:[~1993-07-09  6:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-07-09  4:54 A truly revolting feature 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).