summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-12-08 09:04:48 +0000
committerJim Meyering <jim@meyering.net>2003-12-08 09:04:48 +0000
commit91adac3eabddeb2b8d1e27679d65d92678f13c54 (patch)
treeb0d06a407ae59146d2290d57c7dcaf24404d267e
parent710dca5363eb48cd74ed9e276f77f611333a60f2 (diff)
downloadcoreutils-91adac3eabddeb2b8d1e27679d65d92678f13c54.tar.xz
Don't assume that 'ls' output is fixed-width.
-rwxr-xr-xtests/cp/same-file3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 4f9349ef5..de5cf61ca 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-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.