Subject: bin/7814: Handling of "cd" seriously broken in "sh"
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 06/19/1999 09:05:43
>Number:         7814
>Category:       bin
>Synopsis:       Handling of "cd" seriously broken in "sh"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 19 09:05:01 1999
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler                                http://home.owl.de/~tron/
>Release:        990618
>Environment:
System: NetBSD lyssa.owl.de 1.4C NetBSD 1.4C (LYSSA) #0: Wed Jun 16 15:25:38 CEST 1999 tron@lyssa.owl.de:/src/sys/compile/LYSSA i386


>Description:
If a shell script used "cd" within a command substitution the working
directory of the calling shell is changed.

>How-To-Repeat:

Call this shell script:

#!/bin/sh
echo "`cd /`" >/dev/null
pwd
exit 0

It should print out the same of the directory where it was started but
it prints out "/".

>Fix:
Sorry, but I don't know.
>Audit-Trail:
>Unformatted: