#! /bin/sh #---------------------------------------------------------------------------- # remove-menu - remove a menu # # Copyright (c) 2001-2003 Frank Meyer # # Creation: 04.11.2001 fm # Last Update: 19.07.2003 fm # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- file=$1 cmd=$2 grep "^$cmd " $file >/dev/null if [ $? = 0 ] then while read a do set -- $a if [ "$cmd" != "$1" ] then echo $a fi done < $file >/tmp/menu-$$ cp /tmp/menu-$$ $file # don't mv, keep permissions rm /tmp/menu-$$ fi