Das könnte man so machen:
# loop over files that start with 3 digits # the shell will naturally order them, the last will be the max for last in [0-9][0-9][0-9]*; do :; done # strip the first space and everything after it num=$ # get the next number ((next = num + 1)) # pad with zeros printf "%03d" $next