title: Inserting in line using sed command
body: <p>The text in file looks like this:</p>
  
  <pre><code>[homes]
          comment = Home Directories
          path = 
          browseable = 
          writable = yes
          valid users = %S
          valid users = MYDOMAIN\%S
  
  [printers]
          comment = All Printers
          path = /var/spool/samba
          browseable = no
          guest ok = no
          writable = no
          printable = yes
  </code></pre>
  
  <p>I want output as:</p>
  
  <pre><code>[homes]
          comment = Home Directories
          path = /data
          browseable = yes
          writable = yes
          valid users = %S
          valid users = MYDOMAIN\%S
  
  [printers]
          comment = All Printers
          path = /var/spool/samba
          browseable = no
          guest ok = no
          writable = no
          printable = yes
  </code></pre>
  
  <p>I am using this command:</p>
  
  <pre><code>sed -i "\#path# s#.*#&amp; /data#" file
  </code></pre>
  
  <p>It makes changes to everywhere in file where path is located.</p>
  
  <p>Can anyone help me with this?</p>