maxlen.bash: result was 1 too high

Additionally, output 0 instead of 7 on permission errors.
This commit is contained in:
Jakob Unterwurzacher 2016-10-04 10:26:22 +02:00
parent 56c0b19612
commit b068ffbff9

View File

@ -6,13 +6,13 @@
# https://nuetzlich.net/gocryptfs/ # https://nuetzlich.net/gocryptfs/
NAME="maxlen." NAME="maxlen."
LEN=7 LEN=0
while [ $LEN -le 10000 ]; do while [ $LEN -le 10000 ]; do
touch $NAME 2> /dev/null || break touch $NAME 2> /dev/null || break
rm $NAME rm $NAME
LEN=${#NAME}
NAME="${NAME}x" NAME="${NAME}x"
let LEN=LEN+1
done done
echo $LEN echo $LEN