Re: ksh global PWD env variable

2013-07-21 Thread Philip Guenther
On Sun, Jul 21, 2013 at 3:19 PM, Matthias Kilian wrote: > On Mon, Jul 22, 2013 at 12:02:30AM +0200, Jérémie Courrèges-Anglas wrote: >> Matthias Kilian writes: >> > On Sun, Jul 21, 2013 at 10:51:17PM +0200, Joerg Sonnenberger wrote: >> >> On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wr

Re: ksh global PWD env variable

2013-07-21 Thread Alexander Hall
On 07/21/13 23:43, Matthias Kilian wrote: On Sun, Jul 21, 2013 at 10:51:17PM +0200, Joerg Sonnenberger wrote: On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: I for one don't see a general interest in knowing ones parents potentially faked wd. You can find out your wd by saner me

Re: ksh global PWD env variable

2013-07-21 Thread Matthias Kilian
On Mon, Jul 22, 2013 at 12:02:30AM +0200, Jérémie Courrèges-Anglas wrote: > Matthias Kilian writes: > > On Sun, Jul 21, 2013 at 10:51:17PM +0200, Joerg Sonnenberger wrote: > >> On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: > >> > I for one don't see a general interest in knowi

Re: ksh global PWD env variable

2013-07-21 Thread Jérémie Courrèges-Anglas
Matthias Kilian writes: > On Sun, Jul 21, 2013 at 10:51:17PM +0200, Joerg Sonnenberger wrote: >> On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: >> > I for one don't see a general interest in knowing ones parents >> > potentially faked wd. You can find out your wd by saner means.

Re: ksh global PWD env variable

2013-07-21 Thread Matthias Kilian
On Sun, Jul 21, 2013 at 10:51:17PM +0200, Joerg Sonnenberger wrote: > On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: > > I for one don't see a general interest in knowing ones parents > > potentially faked wd. You can find out your wd by saner means. > > There is no way to find th

Re: ksh global PWD env variable

2013-07-21 Thread Matthias Kilian
On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: > I for one don't see a general interest in knowing ones parents > potentially faked wd. You can find out your wd by saner means. All shells (including our pdksh) seem to do this already, but also peek at PWD in the environment at sta

Re: ksh global PWD env variable

2013-07-21 Thread Joerg Sonnenberger
On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: > I for one don't see a general interest in knowing ones parents > potentially faked wd. You can find out your wd by saner means. There is no way to find the logical path without help from the shell. Joerg

Re: ksh global PWD env variable

2013-07-21 Thread Bertrand Janin
> I for one don't see a general interest in knowing ones parents potentially > faked wd. Many things can be faked by the parent. One could check if getcwd() and getenv("PWD") resolves to the same directory if this is a concern. Based on the fact that other shells have a different behavior I was c

Re: ksh global PWD env variable

2013-07-21 Thread Alexander Hall
I for one don't see a general interest in knowing ones parents potentially faked wd. You can find out your wd by saner means. /Alexander Bertrand Janin wrote: >PWD is considered local in /bin/ksh while it is global in most other >shells >(ksh93, csh, bash, zsh). > >In practice, it means calling

ksh global PWD env variable

2013-07-21 Thread Bertrand Janin
PWD is considered local in /bin/ksh while it is global in most other shells (ksh93, csh, bash, zsh). In practice, it means calling getenv("PWD") from a child process returns NULL on ksh (and pdksh) unless you export it before hand. I discovered this while using getenv("PWD") to get the parent she