title: How to get the string with special char $ and '
body: <p>I have a basic question but not able to figure it out how to do this.</p>
  
  <p>I need to frame a command string with a password from a C file and need to execute that command.I am using Linux.</p>
  
  <p>what I am doing is </p>
  
  <pre><code>sprintf(command, "mycommand with password=$passw'ord");
  system(command);
  </code></pre>
  
  <p>The issue what I am facing is when I am using <code>'</code> during the command execution as follow
  <code>'$passw\'ord'</code> ,it is not working.</p>
  
  <p>when tried as follow</p>
  
  <p><code>sprintf(command, "mycommand with password='$passw\'ord'");</code> //not working it showing <code>&gt;</code> in the terminal and showing  error as unterminated <code>'</code></p>
  
  <p>but when passing only <code>'$password'</code> is working ,but I need to pass the <code>'</code> character also.</p>
  
  <p>To try we can use</p>
  
  <pre><code>echo  '$password' //working
  echo  '$passw\\'ord' //Not working
  </code></pre>
  
  <p>Is there any thing for this.</p>