GNU bug report logs -
#33113
ls: incorrect quoting of "="
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
Moreover, while & is not a metacharacter, it is a special character
that should be quoted for practical reasons.
In particular, this inconsistency with -bF makes a\=b&c unusable by
copy-paste, as a\=b&c can't be used directly in a shell command, and
'a\=b&c' is not OK either.
Note: Such filenames with = and & can be produced by "wget -r".
--
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
This bug report was last modified 6 years and 231 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.