GNU bug report logs - #33113
ls: incorrect quoting of "="

Previous Next

Package: coreutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Sun, 21 Oct 2018 23:45:02 UTC

Severity: normal

Tags: confirmed

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Vincent Lefevre <vincent <at> vinc17.net>
Cc: 33113 <at> debbugs.gnu.org
Subject: bug#33113: incorrect and inconsistent quoting in ls output
Date: Mon, 22 Oct 2018 01:21:40 -0700
Vincent Lefevre wrote:
> I get the following with ls (GNU coreutils) 8.30.
> 
> zira% touch a=b a=b\&c
> zira% ls a=b*
> 'a=b'  'a=b&c'
> zira% ls -b a=b*
> a=b  a=b&c
> zira% ls -F a=b*
> 'a=b'  'a=b&c'
> zira% ls -bF a=b*
> a\=b  a\=b&c
> 
> AFAIK, the = character is not a shell metacharacter (except with zsh
> but only in the first position), thus does not need to be quoted.

'=' is a shell metacharacter after 'set -k' in Bash.

> Moreover, while & is not a metacharacter, it is a special character
> that should be quoted for practical reasons.

As far as I can see '&' is being quoted correctly in the above examples. -b 
means to quote for C strings, not for the shell. If you want to quote for the 
shell, try --quoting-style='shell-escape'.




This bug report was last modified 6 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.