summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-03-23 23:35:32 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-03-23 23:35:32 +0000
commit6fe4cc7f919d577b39ea222a87629b11bfeff4dc (patch)
tree62ac45862cee23896a9b78ecc30ea8d3f274426f
parent9b109290deb9f5417c8455bbcf65719917ad9fb1 (diff)
downloadcoreutils-6fe4cc7f919d577b39ea222a87629b11bfeff4dc.tar.xz
Test the new nohup behavior.
-rwxr-xr-xtests/misc/nohup20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/misc/nohup b/tests/misc/nohup
index 220545189..112811705 100755
--- a/tests/misc/nohup
+++ b/tests/misc/nohup
@@ -28,20 +28,24 @@ fail=0
nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1
# Be careful. The results of the above nohup command
-# change depending on whether stdout is redirected.
+# change depending on whether stdin and stdout are redirected.
if test -t 1; then
test "`cat nohup.out`" = stdout || fail=1
- cat <<\EOF > exp || fail=1
-nohup: appending output to `nohup.out'
-stderr
-EOF
+ if test -t 0; then
+ echo 'nohup: ignoring input and appending output to `nohup.out'\'
+ else
+ echo 'nohup: appending output to `nohup.out'\'
+ fi >exp || fail=1
else
# Here it should not even exist.
test -f nohup.out && fail=1
- cat <<\EOF > exp || fail=1
-stderr
-EOF
+ if test -t 0; then
+ echo 'nohup: ignoring input' >exp
+ else
+ rm -f exp
+ fi || fail=1
fi
+echo 'stderr' >> exp || fail=1
cmp exp err || fail=1
test $fail = 1 && diff exp err 2> /dev/null