mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-23 18:05:42 +08:00
Avoid triggering a bug in OSF/Tru64's sed
that would cause an unwarranted test failure.
This commit is contained in:
parent
8c756b5ed6
commit
400a1fc781
10
tests/rm/rm3
10
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
|
||||
|
10
tests/rm/rm5
10
tests/rm/rm5
@ -39,9 +39,13 @@ fi
|
||||
fail=0
|
||||
|
||||
rm -ir d < 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/^ //' > 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/^ //' > o2
|
||||
mv o2 out
|
||||
|
||||
# Make sure it's been removed.
|
||||
|
Loading…
Reference in New Issue
Block a user