2 # ELinks old bookmarks format to new format converter.
4 # WARNING: Close all ELinks sessions before running this script.
5 # This script converts ELinks bookmarks file with '|' as separator to new
6 # bookmarks format where separator is tab char. It saves old file to
7 # ~/.links/bookmarks.with_pipes. --Zas
9 # Script by Stephane Chazelas :)
11 BMFILE
=$HOME/.links
/bookmarks
12 if [ ! -r "$BMFILE" ]; then
13 echo "$BMFILE does not exist or is not readable!" >&2
17 if [ -f "${BMFILE}.with_pipes" ]; then
18 echo "It seems you already ran this script." >&2
19 echo "Remove ${BMFILE}.with_pipes to force execution." >&2
23 if cp -f "$BMFILE" "${BMFILE}.with_pipes" \
24 && tr '|' '\011' < ${BMFILE}.with_pipes
> $BMFILE
26 echo "Bookmarks file converted."
27 echo "Old file was saved as ${BMFILE}.with_pipes."
28 echo "You may want to copy ~/.links/bookmarks to ~/.elinks/bookmarks now."
30 echo "Conversion failure" >&2