From 5372a756a42e467be2882bee4dd7780e9a5b0101 Mon Sep 17 00:00:00 2001 From: clement Date: Mon, 8 Jun 2020 16:01:45 +0800 Subject: [PATCH] Script handles padded integers for file namings --- scripts/build-website.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-website.sh b/scripts/build-website.sh index 4f3469f..35936d4 100755 --- a/scripts/build-website.sh +++ b/scripts/build-website.sh @@ -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.*