Problem in making a script

Amrit Pal Pathak amritpalpathak1 at gmail.com
Mon Jul 18 11:05:37 UTC 2011


Hey Nils & all
                                Again back for your  help.Your above help
was really cool.Rocks!!
I have problem in following code.Here i am replacing a user's enter password
with 53 number line of a file.It is replacing with no problem.But the part
"$db_password" is not being replaced in file ,only password(suppose=>123) is
placed at line number 53 .

echo "Pleae enter your  mysql's root password"
read pw
TOKKK=$(mktemp)
head -n $((53 - 1)) "config.php" > "$TOKKK"
echo "$db_password = $pw" >> "$TOKKK"
LEN=$(cat "config.php"|wc -l)
tail -n $(($LEN - 53)) "config.php" >> "$TOKKK"
mv  "$TOKKK" "config.php"


Why?
What might be wrong?

Thank in a advance !!
amritpalpathak.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110718/f3babdd5/attachment.html>


More information about the ubuntu-users mailing list