title: sed not working from java program, but the input line works from terminal
body: <p>When I enter the line:</p>
  
  <pre><code>sed -i 's/DNS1="8.8.8.8"/DNS1="8.8.4.4"/' /etc/sysconfig/network-scripts/ifcfg-eth0
  </code></pre>
  
  <p>I get the desired result (i.e. 8.8.8.8 is replaced with 8.8.4.4), however, I have a jave program that passes the same command as shown here:</p>
  
  <pre><code>public static void swapDns() throws IOException, InterruptedException 
  {
      Runtime rt = Runtime.getRuntime();
      Process ps;
  
      String cmd[] = {"sed","-i","'s/DNS1=\"8.8.8.8\"/DNS1=\"8.8.4.4\"/'","/etc/sysconfig/network-scripts/ifcfg-eth0"};
      ps = rt.exec(cmd);
  } 
  </code></pre>
  
  <p>and it doesn't work. It doesn't change anything. Is there an issue with sed/java, or am I missing something... </p>