export var=~root does not expand ~root to /root

Bug #1908025 reported by Ian! D. Allen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
New
Undecided
Unassigned

Bug Description

Shouldn't these give the same results in dash, i.e. "/root"?
They give the same output in bash.

$ dash
$ var=~root
$ echo "$var"
/root
$ export var=~root
$ echo "$var"
~root

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: dash 0.5.10.2-6
ProcVersionSignature: Ubuntu 5.4.0-56.62-generic 5.4.73
Uname: Linux 5.4.0-56-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.13
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon Dec 14 00:14:44 2020
EcryptfsInUse: Yes
InstallationDate: Installed on 2020-10-07 (67 days ago)
InstallationMedia: Lubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: dash
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ian! D. Allen (idallen) wrote :
Revision history for this message
Jilles Tjoelker (jilles) wrote :

I agree that this is a useful feature (including that export a=$b does not split words and export a=* does not generate pathnames); FreeBSD sh has had it for a few years: https://cgit.freebsd.org/src/commit/?id=84fbdd8ca068ec63c6c9a931303d3811738128cb .

It is specified by https://www.austingroupbugs.net/view.php?id=351 planned for the next major revision of POSIX.1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.