coreutils/tests/fixtures/util/is_atty.sh

25 lines
345 B
Bash
Raw Normal View History

2024-02-07 21:02:19 +00:00
#!/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"
2024-02-25 17:54:10 +00:00
echo "terminal size: $(stty size)"
2024-02-07 21:02:19 +00:00
else
echo "stderr is not atty"
fi
>&2 echo "This is an error message."
true