Aigor 3 Posted February 22 Share Posted February 22 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 February 22 Share Posted February 22 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 February 22 Author Share Posted February 22 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.