I just noticed that on one of my machines (running Debian Sid) whenever I type
ls
I immediately checked my aliases, only to find them intact.
wyatt@debian630:~/testdiralias alias ls='ls --color=auto' alias wget='wget --content-disposition' wyatt@debian630:~/testdir
ls 'test 1.txt' test1.txt 'thishasasinglequotehere'''.txt' wyatt@debian630:~/testdir
ls ''''test 1.txt'''' test1.txt 'test 1.txt' 'thishasasinglequotehere'''.txt'
update with new coreutils-8.26 output (which is admittedly much less confusing, but still irritating to have by default). Thanks to Pádraig Brady for this printout:
ls -N 'test 1.txt' test1.txt test 1.txt thishasasinglequotehere'.txt
Why is this happening? How do I stop it properly?
to clarify, I myself set ls to automatically color output. It never put quotes around things before.
I’m running
bash
EDIT: Appears the coreutils developers thought (link) it would be a good idea to make that a global default despite breaking the principle of least astonishment as well as 46+ years of UNIX tradition.
Any way to fix this without a recompile?
UPDATE – October 2017 – Debian Sid has re-enabled the shell escape quoting by default. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877582
And at the bottom of the reply chain to the previous bug report, "the change was intentional and will remain." https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813164#226
I thought this had already been settled, but apparently it was just reverted so that the "stable" Debian branch could keep its "feature freeze" while getting the other fixes, etc. from the newer version. So that’s a shame (in my opinion).
UPDATE: April 2019: Just found a spurious bug report in PHP that was caused by this change to
ls
Update: Android toybox
ls
ls
ls
ls() { # only way I can stop ls from escaping with backslashes if [ -t 1 ]; then /system/bin/ls -C@ |cat fi }