svn path=/trunk/; revision=10
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}"
;;