On Fri, Feb 14, 2025 at 04:40:32PM +0000, [email protected] wrote:
> Package: dash
> Version: 0.5.12-12
> Severity: important
> 
> Dear Maintainer,
> 
> this is basically a copy of https://bugs.debian.org/443685 but for dash
> instead of bash.
> 
> The discussion at https://austingroupbugs.net/view.php?id=1234 is
> helpful.
> 
> This behavior of bash is the correct posix behavior:
> ```
> $ bash -o posix -c 'a=\\; echo $a\/*'
> /bin /boot /dev /etc /home /initrd.img /initrd.img.old /lib /lib64 
> /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var 
> /vmlinuz /vmlinuz.old
> ```
> 
> dash instead behaves this way:
> ```
> $ dash -c 'a=\\; echo $a\/*'
> \/*
> ```

This is not a bug.  The backslash in $a joins up with the backslash
before the slash, thus forming a double backslash which is taken
as a a literal backslash.

This does not contradcit any existing POSIX standard.

In fact every shell other than bash does the same thing.

Cheers,
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply via email to