Subject: bin/31548: Unexpected behavior with $PWD in sh(1)
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <"alex
List: netbsd-bugs
Date: 10/10/2005 20:43:00
>Number:         31548
>Category:       bin
>Synopsis:       Unexpected behavior with $PWD in sh(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 10 20:43:00 +0000 2005
>Originator:     Alexander Rigbo
>Release:        2.0.2
>Organization:
>Environment:
NetBSD safari.rigbo.net 2.0 NetBSD 2.0 (GENERIC) #0: Wed Dec  1 10:58:25 UTC 2004  builds@build:/big/builds/ab/netbsd-2-0-RELEASE/i386/200411300000Z-obj/big/builds/ab/netbsd-2-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386
>Description:
$PWD is not set in new shells, until you use a shell builtin that deals with directories. See how i repeat it.
>How-To-Repeat:
You might have to start it with "env - sh" if you're not using sh as your login shell.

$ echo $PWD

$ pwd
$ echo $PWD
/usr/home/alex
$
---
$ echo $PWD

$ cd ..
$ echo $PWD
/usr/home
$
>Fix:
set $PWD at startup.
other shells to that.