renamed 27001 NL versions

This commit is contained in:
Richard Kranendonk 2026-04-22 14:20:22 +02:00
parent aa91ee4da5
commit 5f2aa5220a
38 changed files with 33 additions and 53 deletions

View file

@ -16,7 +16,7 @@ fi
# Adjust OBSIDIAN_CLI to the command you actually use (e.g. `obsidian`).
: ${OBSIDIAN_CLI:=obsidian}
files=(ISO_27002_2022_NL_*.md(N))
files=(ISO27001-2023-NL-*.md(N))
if (( ${#files} == 0 )); then
print 'No matching files found.'
exit 0
@ -24,27 +24,9 @@ fi
for src in "$files[@]"; do
base=${src:t}
if [[ $base =~ '^ISO_27002_2022_NL_([0-9]+\.[0-9]+)_[A-Z]+ (.+)\.md$' ]]; then
if [[ $base =~ '^ISO27001-2023-NL-([0-9]+\.?[0-9]*)\.md$' ]]; then
version=${match[1]}
rest=${match[2]}
target="a-${version}-${rest}.md"
target=${target// /-}
target=${target//,}
target=${target//\(}
target=${target//\)}
target=${target//\'}
# Replace diacritics with base characters
target=${target//ï/i}
target=${target//é/e}
target=${target//è/e}
target=${target//ê/e}
target=${target//ë/e}
target=${target//ö/o}
target=${target//ü/u}
target=${target//ó/o}
target=${target//ô/o}
# Prevent double dashes
target=${target//--/-}
target="c-${version}.md"
if [[ $src == $target ]]; then
print "SKIP $src"
continue