Aigor 3 Posted Monday at 02:33 PM Share Posted Monday at 02:33 PM Hi, i apologize if my post is off-topic, so, i'm in developing bacula into synology, but i have several programming question, first of all, i need to search via sed a string like this dbpassword = "" and i need to change like this dbpassword = "something that comes from a variable" If someone would like to help, i can write more info Many Thanks Quote Link to post Share on other sites
flyride 484 Posted Monday at 04:13 PM Share Posted Monday at 04:13 PM Here is one way: $ n=\"newpass\" $ echo dbpassword="" >/tmp/test $ sed "s/dbpassword=""/dbpassword=$n/" /tmp/test dbpassword="newpass" $ Quote Link to post Share on other sites
Aigor 3 Posted Monday at 04:30 PM Author Share Posted Monday at 04:30 PM 16 minutes ago, flyride said: Here is one way: $ n=\"newpass\" $ echo dbpassword="" >/tmp/test $ sed "s/dbpassword=""/dbpassword=$n/" /tmp/test dbpassword="newpass" $ Thank you very much i will try Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.