Subject: Re: A shell gotcha
To: John F. Woods <jfw@jfwhome.funhouse.com>
From: Aleksi Suhonen <ams@lenkkari.cs.tut.fi>
List: current-users
Date: 04/16/1995 02:21:04
In message 199504151750.NAA02928@jfwhome.funhouse.com "John F. Woods" told
}-The obvious solution was to figure out how to arrange for the .aliases
}-file not to make /bin/sh choke. After many false starts, I discovered
}-that pdksh defines an environment variable "KSH_VERSION", which makes
}-a handy test for which shell is running the script. (The ksh syntax
}-has to be kept out of the file, so I "dot" the ksh specific stuff.)
}-It turns out that zsh (what I'd been using for a while) also defines a
}-version variable ("ZSH_VERSION"), making a three-way split easy to
}-arrange. For csh fans, tcsh defines a "version" variable.
Actually Older versions of zsh used an entirely different variable
for version. (But I don't remember which one ... :( )
--
Aleksi Suhonen