From 5d8a6a73aea1377c42a2779a0bb9a70dd250e8e1 Mon Sep 17 00:00:00 2001 From: redxef Date: Mon, 10 Mar 2025 19:41:19 +0100 Subject: [PATCH] fix: truncate filenames after 128 bytes. --- fromtext.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fromtext.sh b/fromtext.sh index 82367e7..b4cb953 100755 --- a/fromtext.sh +++ b/fromtext.sh @@ -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))