err=$(mkdir -m 0700 "$candidate_dir" 2>&1) && \
{ echo "$candidate_dir"; return; }
test $MAX_TRIES -le $i && break;
- i=$(expr $i + 1)
+ i=$(( i + 1 ))
done
die "$err"
}
echo "## - $0:${BASH_LINENO[0]}"
while FUNC=${FUNCNAME[$i]}; test "$FUNC" != "main"; do
echo "## $i ${FUNC}() called from ${BASH_SOURCE[$i]}:${BASH_LINENO[$i]}"
- i=$(($i + 1))
+ i=$(( i + 1 ))
done
}
test -f "$i" || break # nothing is found (expands to debug.log*)
name=${i##debug.log_}
name=${name%%_*}
- test "$name" = "DEBUG" && { name="$name$idx" ; idx=$(($idx + 1)) ; }
+ test "$name" = "DEBUG" && { name="$name$idx" ; idx=$(( idx + 1 )) ; }
echo "<======== Debug log $i ========>"
sed -e "s,^,## $name: ," "$i"
done