summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-06-22 14:05:35 +0100
committerJoe Carstairs <me@joeac.net>2026-06-22 14:05:35 +0100
commitdc43029892106c004fc2ef0a8be07954706d823c (patch)
treeb268a2dd2fdd16cf79f9ef82fedca36792e6dd0f /http
parentbf592223de58e7e22e4df039c66af689705b3a44 (diff)
removes POSIX-incompatible :: substitutions in prune_blog
Diffstat (limited to 'http')
-rwxr-xr-xhttp/bin/prune_blog10
1 files changed, 6 insertions, 4 deletions
diff --git a/http/bin/prune_blog b/http/bin/prune_blog
index 51be54a..849b293 100755
--- a/http/bin/prune_blog
+++ b/http/bin/prune_blog
@@ -18,19 +18,21 @@ do
fi
post_rel_path="$(echo "$post" | cut -c${#BLOG_DIR_IN_SRC}- | cut -c3-)"
- post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-1}"
+ post_basename_len=$(( ${#post_rel_path} - ( ${#last_segment} + 1 ) ))
+ post_basename="$(echo "${post_rel_path}" | cut -c1-${post_basename_len})"
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
if [ -f "$post_src" ]
then
continue
fi
- penultimate_segment="${post::${#post}-${#last_segment}-1}"
+ penultimate_segment_len=$(( ${#post} - ( ${#last_segment} + 1 ) ))
+ penultimate_segment="$(echo "${post}" | cut -c1-${penultimate_segment_len})"
penultimate_segment="${penultimate_segment##*\.}"
- post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-${#penultimate_segment}-2}"
+ post_basename_len=$(( ${#post_rel_path} - ( ${#last_segment} + ${#penultimate_segment} + 2 ) ))
+ post_basename="$(echo "${post_rel_path}" | cut -c1-${post_basename_len})"
if [ -f "${LAYOUTS}/${penultimate_segment}.layout.${last_segment}" ]
then
- post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-${#penultimate_segment}-2}"
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
if [ -f "$post_src" ]
then