bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33113: incorrect and inconsistent quoting in ls output


From: Vincent Lefevre
Subject: bug#33113: incorrect and inconsistent quoting in ls output
Date: Mon, 22 Oct 2018 01:34:40 +0200
User-agent: Mutt/1.10.1+136 (420226ce) vl-108074 (2018-10-17)

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 <address@hidden> - 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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]