DASH Shell discussions
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: Harald van Dijk <harald@gigawatt.nl>
Cc: dash@vger.kernel.org
Subject: Re: command -v ../foo when ../foo is a directory
Date: Tue, 16 Aug 2022 16:13:56 +0200	[thread overview]
Message-ID: <87pmh01djv.fsf@latte.josefsson.org> (raw)
In-Reply-To: <296789cd-17a7-90aa-7f81-0612ebf1310a@gigawatt.nl> (Harald van Dijk's message of "Tue, 16 Aug 2022 15:04:21 +0100")

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

Harald van Dijk <harald@gigawatt.nl> writes:

> POSIX says for command -v:
>
>> Utilities, regular built-in utilities, command_names including a
>   <slash> character, and any implementation-defined functions that are 
> found using the PATH variable (as described in Command Search and
> Execution), shall be written as absolute pathnames.
>
> ../bar is a command_name including a <slash> character. There is
> nothing in here that says to check whether it is executable, POSIX
> just says to write it as an absolute pathname, and that is what dash
> does.

Interesting, thank you!  It looks like a bug in the POSIX specs, perhaps
we can get it clarified?  Either by mandating a particular behaviour
going forward, or at least acknowledge the different interpretations
somehow.

/Simon

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

      reply	other threads:[~2022-08-16 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmh01djv.fsf@latte.josefsson.org \
    --to=simon@josefsson.org \
    --cc=dash@vger.kernel.org \
    --cc=harald@gigawatt.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox