miscutils/rr

17 lines
281 B
Plaintext
Raw Permalink Normal View History

2022-06-10 03:51:20 -04:00
#!/bin/sh
2024-06-17 06:11:11 -04:00
[ $# -eq 0 ] && echo "usage: $0 command ..." && exit 64
2022-06-10 03:51:20 -04:00
tmp1=$(mktemp $0.XXXXXXXXXX)
tmp2=$(mktemp $0.XXXXXXXXXX)
trap "rm $tmp1 $tmp2; exit 0" 1 2 15
while "$@" >$tmp2
do
if ! diff $tmp1 $tmp2
then
cp $tmp2 $tmp1
else
echo -n "."
fi
sleep 2
done
rm $tmp1 $tmp2