rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Dave Mason <dmason@plg.uwaterloo.ca>
To: dws@ssec.wisc.edu
Cc: es@hawkwind.utcs.toronto.edu, rc@hawkwind.utcs.toronto.edu
Subject: distinguishing shells
Date: Thu, 23 Sep 1993 20:14:20 -0400	[thread overview]
Message-ID: <93Sep23.201427edt.230427@plg.uwaterloo.ca> (raw)
In-Reply-To: <9309232223.AA27120@ssec.ssec.wisc.edu> (dws@ssec.wisc.edu)

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

../Dave

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


           reply	other threads:[~1993-09-24  0:15 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9309232223.AA27120@ssec.ssec.wisc.edu>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93Sep23.201427edt.230427@plg.uwaterloo.ca \
    --to=dmason@plg.uwaterloo.ca \
    --cc=dws@ssec.wisc.edu \
    --cc=es@hawkwind.utcs.toronto.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).