mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
simulate terminal utility (squash)
This commit is contained in:
parent
5a2e0c700e
commit
a4d5defeef
5 changed files with 348 additions and 29 deletions
21
tests/fixtures/nohup/is_atty.sh
vendored
Normal file
21
tests/fixtures/nohup/is_atty.sh
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -t 0 ] ; then
|
||||
echo "stdin is atty"
|
||||
else
|
||||
echo "stdin is not atty"
|
||||
fi
|
||||
|
||||
if [ -t 1 ] ; then
|
||||
echo "stdout is atty"
|
||||
else
|
||||
echo "stdout is not atty"
|
||||
fi
|
||||
|
||||
if [ -t 2 ] ; then
|
||||
echo "stderr is atty"
|
||||
else
|
||||
echo "stderr is not atty"
|
||||
fi
|
||||
|
||||
true
|
23
tests/fixtures/util/is_atty.sh
vendored
Normal file
23
tests/fixtures/util/is_atty.sh
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -t 0 ] ; then
|
||||
echo "stdin is atty"
|
||||
else
|
||||
echo "stdin is not atty"
|
||||
fi
|
||||
|
||||
if [ -t 1 ] ; then
|
||||
echo "stdout is atty"
|
||||
else
|
||||
echo "stdout is not atty"
|
||||
fi
|
||||
|
||||
if [ -t 2 ] ; then
|
||||
echo "stderr is atty"
|
||||
else
|
||||
echo "stderr is not atty"
|
||||
fi
|
||||
|
||||
>&2 echo "This is an error message."
|
||||
|
||||
true
|
Loading…
Add table
Add a link
Reference in a new issue