Package: posh
Version: 0.14.1
Severity: normal
X-Debbugs-Cc: [email protected]
Dear Maintainer,
I have noticed that the output of export -p is not suitable for reinput
to the shell. Indeed, values that would require quoting are not properly
quoted. However, the SUSv2 standard (which should be close enough to
POSIX in the "Shell & Utilities" section) specifies that:
The -p option allows portable access to the values that can be saved and
then later restored using, for instance, a dot script. The shell will format
the output, including the proper use of quoting, so that it is suitable for
reinput to the shell as commands that achieve the same exporting results.
See this short shell session:
$ export HELLO_WORLD="Hello World"
$ echo "$HELLO_WORLD"
Hello World
$ eval "$(export -p)"
$ echo "$HELLO_WORLD"
Hello
$ export -p
export HELLO_WORLD=Hello
export HOME
export PATH=/usr/bin
export SHELL
export World
-- System Information:
Debian Release: 13.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.15.9-201.fc42.x86_64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Versions of packages posh depends on:
ii debconf [debconf-2.0] 1.5.91
ii libc6 2.41-12
posh recommends no packages.
posh suggests no packages.
-- debconf information:
posh/sh: false