File: netscape-option

package info (click to toggle)
whereami 0.3.36
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: sh: 1,094; perl: 524; makefile: 24
file content (10 lines) | stat: -rwxr-xr-x 263 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
#!/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