#!/bin/sh

# Backup the gophermap
cp ~/gopher/gophermap ~/gopher/gophermap.old
# Embed the latest post
# Apparently, the errors I was getting here were because of the
# comments - the BSD ed doesn't have them, so I'm "emulating"
# them by shelling out.  That's probably slowing me down a wee
# bit too much, but - ugh, I don't like leaving ed scripts
# uncommented.
ed -s ~/gopher/gophermap 2>/dev/null <<EOF
!# Delete all the lines from 'latest - start' to 'latest - end'
/^# latest - start/,/^# latest - end/d
!# Add a new 'latest - start' header
i
# latest - start