summaryrefslogtreecommitdiff
path: root/tests/rm/rm3
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rm/rm3')
-rwxr-xr-xtests/rm/rm310
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/rm/rm3 b/tests/rm/rm3
index 018c4ae66..98b7ff9bf 100755
--- a/tests/rm/rm3
+++ b/tests/rm/rm3
@@ -49,9 +49,13 @@ EOF
# Both of these should fail.
rm -ir z < in > out 2>&1 || fail=1
-# The following loses with Tru64's sed, since that sed mistakenly
-# tacks a newline onto the end of the file.
-tr '?' '\n' < out |sed 's/^ //' |sort > o2
+
+# Given input like `rm: ...? rm: ...? ' (no trailing newline),
+# the `head...' part of the pipeline below removes the trailing space, so
+# that sed doesn't have to deal with a line lacking a terminating newline.
+# This avoids a bug whereby some vendor-provided (Tru64) versions of sed
+# would mistakenly tack a newline onto the end of the output.
+tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
mv o2 out
sort <<EOF > exp || fail=1