#!/bin/sh # # Compute a new version string for a shell script if the script has # been changed since the last time this script was run. # [ -x /usr/bin/md5sum ] || exit 0 FILE=$1 old=`grep "^MD5SUM=" $FILE | sed -e 's/.*=//' -e 's/"//g'` cur=`grep -v "^MD5SUM=" $FILE | md5sum` if [ "$old" != "$cur" ]; then ed -s $FILE -- <