Skip to content

Commit 2fad297

Browse files
committed
Added utility script
1 parent a1608c2 commit 2fad297

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/check_numeric_filenames.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# check_numeric_filenames.sh
4+
# Konstantin Pavlov, [email protected]
5+
#
6+
# simple utility script is useful whe thew directory holds enumerated files and
7+
# you want to check that there is no missing files in the sequence
8+
9+
10+
# serching filenames with pattrn "001*", "002*", "003*" and so on up to "905*"
11+
# you get a prompt if any file is missing
12+
for i in $(seq -f "%03g" 1 905)
13+
do
14+
echo -n "$i "
15+
if test -n "$(find . -maxdepth 1 -name "$i *" -print -quit)"
16+
then
17+
echo "" #"exists"
18+
else
19+
echo "ERR: $i file doesn't exist"
20+
fi
21+
done

0 commit comments

Comments
 (0)