diff options
Diffstat (limited to 'home')
-rwxr-xr-x | home/john/.dillo/bm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/home/john/.dillo/bm b/home/john/.dillo/bm new file mode 100755 index 0000000..cc26f23 --- /dev/null +++ b/home/john/.dillo/bm @@ -0,0 +1,27 @@ +#!/bin/sh + +# bm -- re-arrange dillo bookmarks + +awk -F: ' + /^s0 / { + sub(/^s0 /, "") + new[i++] = $0 + next + } + { + print + } + /^:/ { + sub(/^ */, "", $3) + section[$3] = $2 + } + END { + if(section["Archive"]==""){ + print "error: section Archive not found" > "/dev/stderr" + exit 1 + } + for(j = 0; j<i; j++) + print section["Archive"] " " new[j] + } +' ~/.dillo/bm.txt > ~/.dillo/bm.tmp && +mv ~/.dillo/bm.tmp ~/.dillo/bm.txt |