mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
config terminal simulation for specific stdios only
This commit is contained in:
parent
eacf53d010
commit
537941b676
5 changed files with 189 additions and 73 deletions
21
tests/fixtures/nohup/is_a_tty.sh
vendored
Normal file
21
tests/fixtures/nohup/is_a_tty.sh
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -t 0 ] ; then
|
||||
echo "stdin is a tty"
|
||||
else
|
||||
echo "stdin is not a tty"
|
||||
fi
|
||||
|
||||
if [ -t 1 ] ; then
|
||||
echo "stdout is a tty"
|
||||
else
|
||||
echo "stdout is not a tty"
|
||||
fi
|
||||
|
||||
if [ -t 2 ] ; then
|
||||
echo "stderr is a tty"
|
||||
else
|
||||
echo "stderr is not a tty"
|
||||
fi
|
||||
|
||||
true
|
21
tests/fixtures/nohup/is_atty.sh
vendored
21
tests/fixtures/nohup/is_atty.sh
vendored
|
@ -1,21 +0,0 @@
|
|||
#!/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
|
|
@ -1,22 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -t 0 ] ; then
|
||||
echo "stdin is atty"
|
||||
echo "stdin is a tty"
|
||||
echo "terminal size: $(stty size)"
|
||||
else
|
||||
echo "stdin is not atty"
|
||||
echo "stdin is not a tty"
|
||||
fi
|
||||
|
||||
if [ -t 1 ] ; then
|
||||
echo "stdout is atty"
|
||||
echo "stdout is a tty"
|
||||
else
|
||||
echo "stdout is not atty"
|
||||
echo "stdout is not a tty"
|
||||
fi
|
||||
|
||||
if [ -t 2 ] ; then
|
||||
echo "stderr is atty"
|
||||
echo "terminal size: $(stty size)"
|
||||
echo "stderr is a tty"
|
||||
else
|
||||
echo "stderr is not atty"
|
||||
echo "stderr is not a tty"
|
||||
fi
|
||||
|
||||
>&2 echo "This is an error message."
|
Loading…
Add table
Add a link
Reference in a new issue