rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* distinguishing shells
       [not found] <9309232223.AA27120@ssec.ssec.wisc.edu>
@ 1993-09-24  0:14 ` Dave Mason
  0 siblings, 0 replies; only message in thread
From: Dave Mason @ 1993-09-24  0:14 UTC (permalink / raw)
  To: dws; +Cc: es, rc

DaviD W Sanderson <dws@ssec.wisc.edu> asked for a way to differentiate between
rc/es and the other shells.

This works:

 y=`echo`false;$y&&echo rc or es||echo sh

(it *does* expect there to be a false accessible to /bin/sh, but that
seems fairly likely, and it doesn't require anything for the rc side.)

In trying a few things, one of my ideas was to:
 $SHELL -c '~ 5 5 2>/dev/null' && echo rc || echo sh

To my surprise, rc gave a syntax error because the ~ builtin doesn't
accept I/O redirection.  (It actually doesn't work anyway because
/bin/sh complains about '~ not found' before the stderr redirect.)


(I forwarded this to the rc list in case anyone there needed it too.)

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

only message in thread, other threads:[~1993-09-24  0:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9309232223.AA27120@ssec.ssec.wisc.edu>
1993-09-24  0:14 ` distinguishing shells Dave Mason

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