Aigor Posted February 22, 2021 Share #1 Posted February 22, 2021 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 comment Share on other sites More sharing options...
flyride Posted February 22, 2021 Share #2 Posted February 22, 2021 Here is one way: $ n=\"newpass\" $ echo dbpassword="" >/tmp/test $ sed "s/dbpassword=""/dbpassword=$n/" /tmp/test dbpassword="newpass" $ Quote Link to comment Share on other sites More sharing options...
Aigor Posted February 22, 2021 Author Share #3 Posted February 22, 2021 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 comment Share on other sites More sharing options...
Polanskiman Posted March 8, 2021 Share #4 Posted March 8, 2021 Topic moved here. Quote Link to comment Share on other sites More sharing options...
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.