#!/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 ~/.dillo/bm.tmp && mv ~/.dillo/bm.tmp ~/.dillo/bm.txt