#!/bin/csh -f # # Extract URLs and titles from a Safari Bookmarks.plist file. # Brent Chivers 2004/Feb/09 # unset histchars # get other users' history characters out of the way unalias * # get other users' .cshrc stuff out of the way cat $* | grep '' | sed -e 's=^ *==' -e 's=$==' | awk '\ /:\/\// { url = $0 ; folder = "" ; next } \ /^[0-9]+\.[0-9]$/ { next } \ /WebBookmarkTypeLeaf/ { url = "" ; getline ; next } \ /WebBookmarkTypeList/ { printf ("------ %s\n", folder) ; url = "" ; next } \ { if ( url != "") { printf ("%s\n", url, $0) ; url = "" ; next }} \ { folder = $0 ; url = "" }'