#!/bin/sh # uninstall-magic for VideoteXt # # $Id: uninstall-magic,v 1.1 1997/09/14 01:49:21 mb Exp mb $ # # Copyright (c) 1997 Martin Buck # Read COPYING for more information # This script uninstalls entries from the system magic file which were put # there by install-magic. set -e if [ $# -ne 1 ]; then echo "Usage: $0 magic-file" >&2 exit 1 fi trap 'rm -f "$1.vtxnew"' 0 cp -p "$1" "$1.vtxnew" gawk ' /^#.*VideoteXt/ { skip = 1 next } /^#/ { if (skip == 1) { next } skip = 0 } (skip) { if (/^$/) { skip = 0 } else { skip = 2 } next } { print $0 } ' "$1" > "$1.vtxnew" ln -f "$1.vtxnew" "$1"