From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from plg.uwaterloo.ca ([129.97.140.10]) by hawkwind.utcs.toronto.edu with SMTP id <2664>; Thu, 23 Sep 1993 20:15:01 -0400 Received: by plg.uwaterloo.ca id <230427>; Thu, 23 Sep 1993 20:14:27 -0400 From: Dave Mason To: dws@ssec.wisc.edu CC: es@hawkwind.utcs.toronto.edu, rc@hawkwind.utcs.toronto.edu In-reply-to: <9309232223.AA27120@ssec.ssec.wisc.edu> (dws@ssec.wisc.edu) Subject: distinguishing shells X-Face: %Q_F^9R-:'3MM7eZ6@E.x@f\*bgatzGv-8d%I~L[p^.F)3QF{kq\UTsu|e#?)3FPwJNvPPB !s*He|-*M^p*~bh"Nywm5NLL\\Rl3r(hWHY*F:$/RdKV*bS";n&#\Ov@*=]mu\}6tP Date: Thu, 23 Sep 1993 20:14:20 -0400 DaviD W Sanderson 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.)