Dash Archive mirror
 help / color / mirror / Atom feed
From: "Дилян Палаузов" <dilyan.palauzov@aegee.org>
To: dash@vger.kernel.org, 1053394@bugs.debian.org
Subject: dash should not propagate aliases to subshells
Date: Tue, 03 Oct 2023 11:54:59 +0200	[thread overview]
Message-ID: <0d627a69d4a68302a86801817751a84e@aegee.org> (raw)

To: 1053394@bugs.debian.org, dash@vger.kernel.org

Hello,

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03_01 
says:

2.3.1 Alias Substitution

When used as specified by this volume of POSIX.1-2017, alias definitions 
shall not be inherited by separate invocations of the shell or by the 
utility execution environments invoked by the shell.


So a subshell shall have no knowledge about the aliases from the 
supershell, and backticks start a subshell.

These programs

#!/bin/bash
alias wslpath=echo
find `wslpath /tmp`

and

#!/bin/dash
alias wslpath=echo
find `wslpath /tmp`

produce different results (bash 5.2.15-3.fc38,  dash 0.5.12-1.fc38) when 
executed on a WSL2 system.  The former program shows the content of the 
current directory, the latter program shows the content of /tmp .

Moreover, I filled this initially towards the Debian Bug tracking system 
(cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053394) , and 
was then told to check http://gondor.apana.org.au/~herbert/dash/ .

Please include in the repository 
https://git.kernel.org/pub/scm/utils/dash/dash.git links to 
http://gondor.apana.org.au/~herbert/dash/ and dash@vger.kernel.org , for 
instance in src/dash.1, so that it is documented where to report 
problems in dash.

Kind regards
   Dilyan

             reply	other threads:[~2023-10-03 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  9:54 Дилян Палаузов [this message]
2023-10-03 19:36 ` dash should not propagate aliases to subshells Lawrence Velázquez

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=0d627a69d4a68302a86801817751a84e@aegee.org \
    --to=dilyan.palauzov@aegee.org \
    --cc=1053394@bugs.debian.org \
    --cc=dash@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).