Recommended Posts

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 

Link to post
Share on other sites
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 

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.