Path: utzoo!utgpu!watmath!att!cbnews!ap From: ap@cbnews.ATT.COM (Alexis Porras) Newsgroups: comp.sys.att Subject: Re: Forcing /bin/sh in a script under V/386 3.2 Korn shell Summary: ksh sillyness Keywords: sh ksh Message-ID: <8591@cbnews.ATT.COM> Date: 25 Jul 89 21:21:05 GMT Expires: 25 Jul 89 21:21:02 GMT References: <14445@bfmny0.UUCP> <1989Jul12.191342.1048@cs.dal.ca> <14463@bfmny0.UUCP> <1792@cadillac.CAD.MCC.COM> <9065@chinet.chi.il.us> Reply-To: ap@cbnews.ATT.COM (Alexis Porras) Distribution: na Organization: _^-+++-_^ Lines: 24 In article <9065@chinet.chi.il.us> kdb@chinet.chi.il.us (Karl Botts) writes: | |Well, let me take a shot: put the following line as the first of any script |you want to run only under ksh, not sh: | |2>/dev/null PPID=0 && { echo "$0: korn shell script" 1>&2; exit 1; } | ... more stuff ... |In fact, there is nothing that ksh can do that sh can't which can be |a bulletproof test, because ksh is supposed to be a superset of sh, and ... more stuff ... | |What is needed is something which sh can do that ksh can't. So far as I ... more stuff ... |I will be delighted if someone can improve on this miserable kludge. I wasn't going to do it but...put this at the top of your ksh script: echo ^false >/dev/null || exec ksh $0 "$@" (or replace "ksh" by a full path name is ksh is not in the standard PATH) Well, that's my contribution to humanity for the week!