Re: ksh version lies

2015-03-15 Thread Patrik Lundin
On Sat, Mar 14, 2015 at 07:29:30PM +, Christian Weisgerber wrote: > > KSH_VERSION shouldn't be removed and if we want to tweak the value, > we need to leave the leading "@(#)PD KSH" alone, which is what > people will most likely match on. This is essentially the "Mozilla/5.0" > user agent iss

Re: ksh version lies

2015-03-14 Thread Christian Weisgerber
On 2015-03-13, Patrik Lundin wrote: > If ksh88 neither has KSH_VERSION or the .sh variables, could the > presence of KSH_VERSION mean "this shell is at least ksh93 equivalent"? No. As far as I can tell, pdksh actually pre-dates ksh93. I don't know when KSH_VERSION was added--possibly at the tim

Re: ksh version lies

2015-03-13 Thread Ted Unangst
Pascal Stumpf wrote: > On Thu, 12 Mar 2015 15:25:48 + (UTC), Christian Weisgerber wrote: > > On 2015-03-12, Patrik Lundin wrote: > > > > >=== > > > elif [ -n "$KSH_VERSION" ]; then > > > HACKING_DIR=$(dirname "${.sh.file}") > > >=== > > > > .sh.file and related dot variables are a ksh93

Re: ksh version lies

2015-03-12 Thread Patrik Lundin
On Fri, Mar 13, 2015 at 10:48:56AM +0900, Pascal Stumpf wrote: > On Thu, 12 Mar 2015 15:25:48 + (UTC), Christian Weisgerber wrote: > > On 2015-03-12, Patrik Lundin wrote: > > > > >=== > > > elif [ -n "$KSH_VERSION" ]; then > > > HACKING_DIR=$(dirname "${.sh.file}") > > >=== > > > > .sh.f

Re: ksh version lies

2015-03-12 Thread Pascal Stumpf
On Thu, 12 Mar 2015 15:25:48 + (UTC), Christian Weisgerber wrote: > On 2015-03-12, Patrik Lundin wrote: > > >=== > > elif [ -n "$KSH_VERSION" ]; then > > HACKING_DIR=$(dirname "${.sh.file}") > >=== > > .sh.file and related dot variables are a ksh93 extension. I don't > think ksh88 suppo

Re: ksh version lies

2015-03-12 Thread Christian Weisgerber
On 2015-03-12, Patrik Lundin wrote: >=== > elif [ -n "$KSH_VERSION" ]; then > HACKING_DIR=$(dirname "${.sh.file}") >=== .sh.file and related dot variables are a ksh93 extension. I don't think ksh88 supports this, so this is unportable even within the ksh family. ... Actually, ksh88 doesn't

Re: ksh version lies

2015-03-12 Thread Patrik Lundin
On Sun, Feb 15, 2015 at 09:00:27PM -0500, Ted Unangst wrote: > ksh (and sh) have a version string embedded in them: > @(#)PD KSH v5.2.14 99/07/13.2 > > This is clearly a lie. We've added, removed, and fixed bugs and features since > then. I first noticed the lie in the man page, then saw that it's

Re: ksh version lies

2015-02-20 Thread Theo de Raadt
>Jérémie Courrèges-Anglas wrote: >> "Ted Unangst" writes: >> >> > Jérémie Courrèges-Anglas wrote: >> >> Tristan Le Guern writes: >> >> >> >> > On 02/16/2015 05:22 PM, Todd C. Miller wrote: >> >> >> There are scripts that use KSH_VERSION to determine whether they >> >> >> are being run und

Re: ksh version lies

2015-02-18 Thread Tristan Le Guern
Le 17/02/2015 23:23, Ted Unangst a écrit : > Jérémie Courrèges-Anglas wrote: >> Tristan Le Guern writes: >> >>> On 02/16/2015 05:22 PM, Todd C. Miller wrote: There are scripts that use KSH_VERSION to determine whether they are being run under ksh or a Bourne shell. That seems like a >>>

Re: ksh version lies

2015-02-18 Thread John Merriam
On Tue, 17 Feb 2015, Adam Thompson wrote: > On 2015-02-17 08:06 PM, John Merriam wrote: > > I definitely agree that the silliness of checking a version string to > > possibly use some exotic or non-standard feature of a particular flavor of a > > particular family of shells is not a good idea when

Re: ksh version lies

2015-02-18 Thread Christian Weisgerber
On 2015-02-17, "Ted Unangst" wrote: >> pdksh is not the same thing as ksh88 or ksh93. And not the same thing as >> mksh, which has grew features since it was based on pdksh from the >> OpenBSD tree. And you may want to avoid known problems in some of those, >> or use known nice features in others

Re: ksh version lies

2015-02-18 Thread Stuart Henderson
On 2015/02/17 21:06, John Merriam wrote: > 2) Remove it completely as proposed by tedu. Some things in ports (like autoconf) check for the existence of KSH_VERSION. The only thing I've noticed so far that checks for "PD KSH" in the contents of KSH_VERSION is ksh.kshrc in base.

Re: ksh version lies

2015-02-17 Thread Adam Thompson
On 2015-02-17 08:06 PM, John Merriam wrote: I definitely agree that the silliness of checking a version string to possibly use some exotic or non-standard feature of a particular flavor of a particular family of shells is not a good idea when writing a shell script. If you can't do what you wa

Re: ksh version lies

2015-02-17 Thread John Merriam
On 2/17/2015 7:40 PM, Ted Unangst wrote: Jérémie Courrèges-Anglas wrote: "Ted Unangst" writes: [...] So let's return to the top. What does "PD KSH" in KSH_VERSION mean? What does one do differently if that string is present or missing? sigh pdksh is not the same thing as ksh88 or ksh93. A

Re: ksh version lies

2015-02-17 Thread Ted Unangst
Jérémie Courrèges-Anglas wrote: > "Ted Unangst" writes: > > [...] > > >> > So let's return to the top. What does "PD KSH" in KSH_VERSION mean? What > >> > does > >> > one do differently if that string is present or missing? > >> > >> sigh > >> > >> pdksh is not the same thing as ksh88 or ksh9

Re: ksh version lies

2015-02-17 Thread Jérémie Courrèges-Anglas
"Ted Unangst" writes: [...] >> > So let's return to the top. What does "PD KSH" in KSH_VERSION mean? What >> > does >> > one do differently if that string is present or missing? >> >> sigh >> >> pdksh is not the same thing as ksh88 or ksh93. And not the same thing as >> mksh, which has grew f

Re: ksh version lies

2015-02-17 Thread Ted Unangst
Jérémie Courrèges-Anglas wrote: > "Ted Unangst" writes: > > > Jérémie Courrèges-Anglas wrote: > >> Tristan Le Guern writes: > >> > >> > On 02/16/2015 05:22 PM, Todd C. Miller wrote: > >> >> There are scripts that use KSH_VERSION to determine whether they > >> >> are being run under ksh or a Bou

Re: ksh version lies

2015-02-17 Thread Jérémie Courrèges-Anglas
"Ted Unangst" writes: > Jérémie Courrèges-Anglas wrote: >> Tristan Le Guern writes: >> >> > On 02/16/2015 05:22 PM, Todd C. Miller wrote: >> >> There are scripts that use KSH_VERSION to determine whether they >> >> are being run under ksh or a Bourne shell. That seems like a >> >> reasonable t

Re: ksh version lies

2015-02-17 Thread Ted Unangst
Jérémie Courrèges-Anglas wrote: > Tristan Le Guern writes: > > > On 02/16/2015 05:22 PM, Todd C. Miller wrote: > >> There are scripts that use KSH_VERSION to determine whether they > >> are being run under ksh or a Bourne shell. That seems like a > >> reasonable thing to do. I don't really care

Re: ksh version lies

2015-02-17 Thread Jérémie Courrèges-Anglas
Tristan Le Guern writes: > On 02/16/2015 05:22 PM, Todd C. Miller wrote: >> There are scripts that use KSH_VERSION to determine whether they >> are being run under ksh or a Bourne shell. That seems like a >> reasonable thing to do. I don't really care what the version >> number is set to. Usin

Re: ksh version lies

2015-02-17 Thread Tristan Le Guern
On 02/16/2015 05:22 PM, Todd C. Miller wrote: > There are scripts that use KSH_VERSION to determine whether they > are being run under ksh or a Bourne shell. That seems like a > reasonable thing to do. I don't really care what the version > number is set to. Using the OpenBSD version seems reaso

Re: ksh version lies

2015-02-17 Thread Craig Skinner
On 2015-02-16 Mon 09:22 AM |, Todd C. Miller wrote: > There are scripts that use KSH_VERSION to determine whether they > are being run under ksh or a Bourne shell. That seems like a > reasonable thing to do. I don't really care what the version > number is set to. Korn scripts here that drive du

Re: ksh version lies

2015-02-16 Thread Todd C. Miller
There are scripts that use KSH_VERSION to determine whether they are being run under ksh or a Bourne shell. That seems like a reasonable thing to do. I don't really care what the version number is set to. Using the OpenBSD version seems reasonable and could be generated at build time. - todd

Re: ksh version lies

2015-02-16 Thread Ted Unangst
Damien Miller wrote: > On Sun, 15 Feb 2015, Ted Unangst wrote: > > > ksh (and sh) have a version string embedded in them: > > @(#)PD KSH v5.2.14 99/07/13.2 > > > > This is clearly a lie. We've added, removed, and fixed bugs and features > > since > > then. I first noticed the lie in the man page

Re: ksh version lies

2015-02-15 Thread Damien Miller
On Sun, 15 Feb 2015, Ted Unangst wrote: > ksh (and sh) have a version string embedded in them: > @(#)PD KSH v5.2.14 99/07/13.2 > > This is clearly a lie. We've added, removed, and fixed bugs and features since > then. I first noticed the lie in the man page, then saw that it's also > exported via

Re: ksh version lies

2015-02-15 Thread Kamil Rytarowski
Ted Unangst wrote: > ksh (and sh) have a version string embedded in them: > @(#)PD KSH v5.2.14 99/07/13.2 > > This is clearly a lie. We've added, removed, and fixed bugs and features since > then. I first noticed the lie in the man page, then saw that it's also > exported via the environment and o

ksh version lies

2015-02-15 Thread Ted Unangst
ksh (and sh) have a version string embedded in them: @(#)PD KSH v5.2.14 99/07/13.2 This is clearly a lie. We've added, removed, and fixed bugs and features since then. I first noticed the lie in the man page, then saw that it's also exported via the environment and other places. Instead of trying