I made a website in php4 that I want to swtich over for my database, I'm a linux newb, I just thought I would write a simple sed script to change the username and password used in mysql_connect:
#!/bin/bash
for f in *
do
sed 's/mysql_connect(\'localhost\',\'user1\',\'pass1\')/mysql_connect(\'localhost\',\'user2\',\'pass2\')/' <$f >$f
done
exit 0
error:
./change: line 4: syntax error near unexpected token `)'
Also, someone mentioned that the script doesn't end? so I added exit 0, Ive only tried scripting once, over a year ago I don't remember ever doing that so if someone could elaborate that would be helpful.