dotfiles/.local/bin/scripts/arg-test

16 lines
342 B
Plaintext
Raw Normal View History

#!/bin/sh
2022-09-03 11:37:33 +00:00
outfile=/tmp/args$(date +%s)
# echo "dot - graphviz version 5.0.1 (0)" >&2
2021-10-22 15:15:09 +00:00
{
2021-12-12 10:35:36 +00:00
echo "$# Args: ${@:-DEFAULT}"
#echo "Starred: $*"
2021-11-06 23:28:57 +00:00
#echo "${@:-default}" | sed 's/\w\+/\0-w/g'
2021-11-02 11:59:08 +00:00
for last; do true; done
echo "Last arg: $last"
2022-09-03 11:37:33 +00:00
} | tee "$outfile"
if tty -s || test "$1" = "-V"
then echo "Not reading from stdin"
else tee "$outfile-stdin"
fi