From 408a5fe49cabd0d7c025e86f9fb0053e57385ef3 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 3 Dec 2017 15:04:54 +0000 Subject: [PATCH] quicker rename function svn path=/trunk/; revision=10 --- index.cgi | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.cgi b/index.cgi index 00006da..12caed1 100755 --- a/index.cgi +++ b/index.cgi @@ -160,10 +160,7 @@ case "$(GET action)" in fid="$(POST fid | checkid)" file="${BDB}/${fid}.bm" if [ "$(POST control)" = confirm -a -n "$name" -a -f "$file" ]; then - order="$(head -n1 "$file" |cut -f3 || printf 1000)" - printf '%s\t%s\t%s\n' "$fid" "$(HTML "$name")" "$order" >"${file%.bm}.tmp" - tail -n+2 "$file" >>"${file%.bm}.tmp" - mv "${file%.bm}.tmp" "$file" + sed -ri "1s'^(${fid}\t)[^\t]+(\t.+)$'\1${name}\2';" "$file" fi REDIRECT "${SCRIPT_NAME}#${fid}" ;; -- 2.39.2