radare2/libr/count.sh

15 lines
259 B
Bash
Raw Normal View History

#!/bin/sh
2021-06-09 19:31:30 +00:00
[ -z "$TMPDIR" ] && TMPDIR=/tmp
[ -w "$TMPDIR" ] || TMPDIR="$PWD"
2021-06-04 16:02:07 +00:00
T=$TMPDIR/.cc.txt
if [ -n "$1" ]; then
echo 1 > "$T"
else
N=`head -n1 $T 2> /dev/null`
2021-11-30 21:00:17 +00:00
[ -z "$N" ] && N=0
2021-10-04 13:38:46 +00:00
N=$((1+$N))
basename `pwd`
echo "$N" | tee "$T" 2> /dev/null
fi
2021-06-04 16:02:07 +00:00
exit 0