Skip to content

Commit 7606351

Browse files
authored
is_a_tty.sh: Reduce lines
1 parent cc103ec commit 7606351

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

tests/fixtures/nohup/is_a_tty.sh

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
#!/bin/bash
22

3-
if [ -t 0 ] ; then
4-
echo "stdin is a tty"
5-
else
6-
echo "stdin is not a tty"
7-
fi
8-
9-
if [ -t 1 ] ; then
10-
echo "stdout is a tty"
11-
else
12-
echo "stdout is not a tty"
13-
fi
14-
15-
if [ -t 2 ] ; then
16-
echo "stderr is a tty"
17-
else
18-
echo "stderr is not a tty"
19-
fi
20-
21-
true
3+
[ -t 0 ] && echo "stdin is a tty" || echo "stdin is not a tty"
4+
[ -t 1 ] && echo "stdout is a tty" || echo "stdout is not a tty"
5+
[ -t 2 ] && echo "stderr is a tty" || echo "stderr is not a tty"
6+
:

0 commit comments

Comments
 (0)