fix indexing issue
This commit is contained in:
parent
a95fab945f
commit
1b1936c7c7
10
cbz/cbzcat
10
cbz/cbzcat
@ -24,18 +24,18 @@ for f in "$@"; do
|
||||
|| usage
|
||||
|
||||
unzip -d "$d"/x "$f"
|
||||
rm "$d"/x/*.xml
|
||||
rm -f "$d"/x/*.xml
|
||||
|
||||
for g in "$d"/x/*; do
|
||||
# if there aren't enough leading zeroes
|
||||
if ! printf '%s' "$i" \
|
||||
| wc -c \
|
||||
| xargs test "$il" =; then
|
||||
for g in "$d"/*
|
||||
do test "$g" = "$d"/x \
|
||||
|| printf '%s\n' "$g" \
|
||||
for h in "$d"/*
|
||||
do test "$h" = "$d"/x \
|
||||
|| printf '%s\n' "$h" \
|
||||
| sed 's|[^/]*$|0&|' \
|
||||
| xargs mv "$g"
|
||||
| xargs mv "$h"
|
||||
done
|
||||
# update index digit length
|
||||
il="$(printf '1 + %s\n' "$il" | bc)"
|
||||
|
Loading…
Reference in New Issue
Block a user