radare2/libr/count.sh
pancake 12c44332a2
Check for subcommands of iz to improve output on invalid input (#19467)
* Minor count fix and r_diff include moved into r_util
2021-12-05 04:43:31 +01:00

15 lines
259 B
Bash
Executable File

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