fix: truncate filenames after 128 bytes.

This commit is contained in:
redxef 2025-03-10 19:41:19 +01:00
parent 7ed8fd5182
commit 5d8a6a73ae
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -11,7 +11,7 @@ main() {
f="$(echo "$line" | awk -F$SEP "{print \$$c}")"
[ -z "$f" ] && continue
if [ "$filename" = '' ]; then
filename="$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -e 's/ /-/g' -e 's/[^a-z0-9-]//g')"
filename="$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -E -e 's/ /-/g' -e 's/[^a-z0-9-]//g' -n -e 's/^(.{0,128}).*$/\1/p')"
fi
echo "$f" > "$filename.$i.md"
i=$((i+1))