NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: misc/40977: /var/backups/work/device.current is overly sensitive to ls(1) columnar alignment
The following reply was made to PR misc/40977; it has been noted by GNATS.
From: David Laight <david%l8s.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: misc/40977: /var/backups/work/device.current is overly sensitive
to ls(1) columnar alignment
Date: Mon, 7 Sep 2009 21:16:14 +0100
On Mon, Sep 07, 2009 at 07:40:04PM +0000, David Holland wrote:
> Another approach is to forcibly set the column widths... or just
> prune all column padding.
...
> The latter would give something like
>
> -type b -o -type c \) -print0 | \
> - xargs -0 ls -ldgTq | sort +9 > $LIST
> + xargs -0 ls -ldgTq | sed 's/ */ /g' | sort +9 > $LIST
>
> although looking at this I am starting to have real doubts about that
> sort +9. It sorts the regular files and directories by name, but the
> devices by year...
Perhaps: sed -e 's/ */ /g' -e 's/, /,/'
However I'm 100% sure that spaces are guaranteed after user and group
names (I've seen 'ls' that don't generate them for maximal length names).
Not to mention the problems of spaces in user/group names and odd
characters in filenames.
So maybe 'ls -nb' should be used.
(Netbsd's ls only seems to have gained -b recently!)
David
--
David Laight: david%l8s.co.uk@localhost
Home |
Main Index |
Thread Index |
Old Index