#!/bin/bash
# usage:
# netscape-option <prefs_file> <option_name> <new_value>
#
FILENAME=$1
echo "Setting $2 to $3 in $FILENAME"
sed -e "s/\($2\",\) .*\();$\)/\1 $3\2/" $FILENAME >$FILENAME.tmp
chmod --reference=$1 $1.tmp
chown --reference=$1 $1.tmp
mv $1.tmp $1
