DASH Shell discussions
 help / color / mirror / Atom feed
* command -v ../foo when ../foo is a directory
@ 2022-08-16 13:01 Simon Josefsson
  2022-08-16 14:04 ` Harald van Dijk
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2022-08-16 13:01 UTC (permalink / raw)
  To: dash

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

Hi.

I noticed a (to me) unexpected difference between bash and dash, compare
bash behaviour:

jas@latte:~$ mkdir -p foo foo/bar
jas@latte:~$ cd foo/bar
jas@latte:~/foo/bar$ command -v ../bar
jas@latte:~/foo/bar$ echo $?
1
jas@latte:~/foo/bar$ 

with dash behaviour:

$ mkdir -p foo foo/bar
$ cd foo/bar
$ command -v ../bar
../bar
$ echo $?
0
$ 

That is, dash's 'command -v' return success on directories for relative
names.  I believe the dash behaviour is incorrect, but I'd appreciate if
someone else read the POSIX spec here.  Do you agree?

This is on Debian bullseye with dash 0.5.11+git20200708+dd9ef66-5 and
bash 5.1-2+deb11u1.

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-16 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-16 13:01 command -v ../foo when ../foo is a directory Simon Josefsson
2022-08-16 14:04 ` Harald van Dijk
2022-08-16 14:13   ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox