NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

standards/59565: sh(1): cd "" must fail



>Number:         59565
>Category:       standards
>Synopsis:       sh(1): cd "" must fail
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 30 17:40:00 +0000 2025
>Originator:     Thomas Klausner
>Release:        NetBSD 10.99.15
>Organization:

>Environment:
	
	
Architecture: x86_64
Machine: amd64
>Description:

POSIX 1003.1-2024 states that 'cd' must fail if given an explicit
empty argument.

Our sh(1) does not do that:

> sh
$ cd ""
$

I think one of the reasons for this is to avoid hidden errors with code
such as

foo=$(some shell script giving no output)
cd "$foo"
...more stuff expected to be happening inside that directory but now happening outside

>How-To-Repeat:
See above.
>Fix:
Yes, perhaps after discussion.

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index