radare2/libr/count.sh
Sergi Àlvarez i Capilla f64c370585 Fix count script
2021-06-10 12:16:18 +02:00

15 lines
243 B
Bash
Executable File

#!/bin/sh
[ -z "$TMPDIR" ] && TMPDIR=/tmp
[ -w "$TMPDIR" ] || TMPDIR="$PWD"
T=$TMPDIR/.cc.txt
if [ -n "$1" ]; then
echo 0 > $T 2> /dev/null
N=0
else
N=`cat $T 2> /dev/null`
fi
N=$(($N+1))
basename `pwd`
echo $N | tee $T 2> /dev/null
exit 0