View Single Post

  #9 (permalink)  
Old 04-02-2006, 10:15 PM
sparky sparky is offline
Member
User
 
Join Date: Mar 2006
Posts: 35
Rep Power: 0
sparky
Default

Quote:
Originally Posted by sparky
Thought of work around for old pass but still stuck as now i can t use $ in my code he what ive got so far.
Code:
#dispaly old rcon pass
echo -n "The old " 
 cat server.cfg |grep rcon_pass*
echo
echo
#set oldpass and new pass vars
echo -n "Please enter old pass : "
read oldpass
echo
echo
echo -n "Please enter new pass : "
read newpass
#set pass
#perl -p -i -e 's/$oldpass/$newpass/g' server.cfg
sed '/rcon_password/s/$oldpass/$newpass/g' server.cfg >   server1.cfg
am trying perl commented out and sed
peal seems best option if i can get that working as there would be no need to mv server1.cfg to server.cfg
But either would be fine

thanks
Reply With Quote