Pádraig Brady wrote:
On 19/05/17 07:48, L A Walsh wrote:
The new format uses extra spacing on columns where it isn't needed --
but the extra space isn't enough to handle the 1 file that was quoted
(needs 5 extra columns). Where does it get '3' (and why doesn't it use
2?)?
Yes one can construct edge cases where this isn't ideal.
The normal case though is the quoted files are interspersed
in various columns.
---
Like this?:
'"'\''"' bbb0 'ddd ddd1' eee0 ggghhh1
'aaa aaa1' bbb2ddd eee2 ggg0 hhh2
aaa0 'ccc ccc1' ddd0fffggg1
aaa2 ccc ddd2fff0 ggg2
'bbb bbb1' ccc0 'eee eee1' fff1 hhh
bbb ccc2eee fff2 hhh0
123456712341234123123
You have 3 different spacings between columns. Your argument
of using 3-spaces for an extra quote vs. 2 when not needed is
looking pretty unsupportable since it doesn't use 3 when quotes
ARE needed (it uses 4). The above could just as easily have been:
'"'\''"' bbb0 'ddd ddd1' eee0 ggghhh1
'aaa aaa1' bbb2dddeee2 ggg0 hhh2
aaa0 'ccc ccc1' ddd0 fffggg1
aaa2 ccc ddd2 fff0 ggg2
'bbb bbb1' ccc0eee1 fff1 hhh
bbb ccc2eeefff2 hhh0
And this:
'"aaa'\''"' bb cc0dd2ffgg0 hh1
'aaa aa1' bb0cc2 'eee ee1' ff0 gg1 hh2
aa0 bb2 'ddd dd1' ee ff1 gg2
aa2 'ccc cc1' dd ee0ff2 hh
'bbb bb1' cc dd0ee2gghh0
12345123123 123 123 123
12345678901234567890123456789012345678901234567890123456789012345678901234567890
Could have been:
'"aaa'\''"' 'bbb bb1''ccc cc1' dd1 ee1 ff gg
hh
'aaa aa1' b ccdd ee ff0 gg0 hh0
aa0 b0 cc0 dd0 ee0 ff1 gg1 hh1
aa2 b2 cc2 dd2 ee2 ff2 gg2 hh2
12 12 12 12 12 12 12
12345678901234567890123456789012345678901234567890123456789012345678901234567890
It's more important to have consistent spacing I think on modern terminals.
But you don't as shown above -- you simply waste an extra space using
3 columns of padding rather than 2.
Anyway with layouts
like this you get more wasted space when a few files have
relatively longer names, irrespective of quoting, which is
a much more common issue.
---
Irrelevant. You are using 3 spaces when no quoting is
needed, instead of 2, forcing an extra column into all output
regardless of name length.
The spacing is increased to 3 to allow for an extra space
for left alignment of non quoted items with quoted ones.
---
As shown above it isn't needed. I have 2 between 2 quoted items,
between a combo w/1-quoted and 1 not, and 2 between non-quoted. 2-spaces
between visible characters in all columns.
The alignment is more important for long listing I think,
but thought it a net benefit for other formats also.
---
For a long listing, you don't multiply the spacing
by N columns. You only have 1 column, so ANY filename w/a quote
would require an extra space for the entire (1) column to line up, but
in a long listing things are still odd looking w/the last column sticking out:
ls -l *[ab]*
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:28 '"aaa'\''"'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 'aaa aa1'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aa0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aa2
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 'bbb bb1'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb2
---vs. non quoted format---
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:28 "aaa'"
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaa aa1
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aa0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aa2
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbb bb1
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bb2
Very simply, the new format is wasting space with no justifiable
reason.