So I got this configuration file and I want to use bash to change the value of one of the parameters. Since I didn't want to use that many regex (or any) and I am confortable wtih vim. I did that script that will modify my parametrs.
The code is the following:
Code:
#!/bin/bash
if [ $# -eq 1 ] then;
vi -c "610" -c "s/1/0/"
-c "611" -c "s/1/0"
-c "612" -c "s/1/0"
-c "wq" ~/.opera/opera6.ini
elif
vi -c "610" -c "s/0/1"
-c "611" -c "s/0/1"
-c "612" -c "s/0/1"
-c "wq" ~/.opera/opera6.ini
fi
Obviously this code doesn't work. First thing is that I want to know wha should I put as a flag definition. I put an if conditional but I think I should have used a switch/case instead.
Also this script doesnt really work, I just get something like this:
Code:
/usr/local/bin/unprox: line 9: syntax error near unexpected token `elif'
/usr/local/bin/unprox: line 9: `elif'
[/code]