summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2020-08-31 21:38:53 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2020-08-31 21:38:53 +0200
commit8f50db881540ed0f085818a03cd3299be16d34d7 (patch)
tree73b2222532ad79d281ac745138bf0c218ba8131f /rc
parent92b57ff5e012c1879de8dca370dcfefd18286d6f (diff)
fifo: Make the command more robust
Diffstat (limited to 'rc')
-rwxr-xr-xrc/connect/commands/:fifo4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/connect/commands/:fifo b/rc/connect/commands/:fifo
index e96e18c..7caa318 100755
--- a/rc/connect/commands/:fifo
+++ b/rc/connect/commands/:fifo
@@ -7,8 +7,8 @@ trap 'rm buffer.fifo' EXIT
# Send to fifo buffer the output of the given command,
# or read from stdin if available.
-if test -t 0; then
+if test $# -gt 0; then
"$@" > buffer.fifo 2>&1 &
-else
+elif test ! -t 0; then
cat > buffer.fifo
fi