1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-17 12:52:16 +02:00

Don't assume that 'ls' output is fixed-width.

This commit is contained in:
Jim Meyering
2003-12-08 09:04:48 +00:00
parent 710dca5363
commit 91adac3eab

View File

@@ -74,11 +74,10 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
# and put brackets around the output.
test -s _err && echo "[`sed 's/^[^:][^:]*:/cp:/' _err`]"
# Strip off all but the file names.
# Omit the variable-width owner and group names.
ls="`ls -gG --ignore=_err . \
| sed \
-e '/^total /d' \
-e 's/^......................................//'`"
-e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`"
echo "($ls)"
# Make sure the original is unchanged and that
# the destination is a copy.