Script handles padded integers for file namings

This commit is contained in:
2020-06-08 16:01:45 +08:00
parent 99730489a6
commit 5372a756a4

View File

@ -4,10 +4,10 @@
# build the blog files
cd ../blog
CONTENTNUM=$(ls content* | wc -l )
CONTENTNUM=$(ls content-* | wc -l )
for i in {0..$CONTENTNUM}
do
cat filehead "content$i" "quote$i" > blog-00$i
cat filehead "content-$(printf \"%03d\" $i)" "quote-$(printf \"%03d\" $i)" > blog-00$i
done
rm filehead content* quote* .blog.*