Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Works, could you explain? Commented Sep 27, 2012 at 3:07
  • 1
    The bash removes quotes when interpreting a command. So when you 'nesting' commands over a long chain of sudo's ssh's and sh's the final command looks not as you expect. Also I removed unnecessary 'sh -c' as it only complicates the things in your case. also I had to add -- 'switch' to sudo to make it stopping to scan the command for switches and treat the rest as a whole command to execute Commented Sep 27, 2012 at 3:13
  • One more question. Maybe related....If I run above command from a command line as php use it's ok. If I run from the browser it's ok but the first line is "Pseudo-terminal will not be allocated because stdin is not a terminal." Any idea? Commented Sep 27, 2012 at 3:34
  • Do you need pty to be allocated? I suppose - no, taking to account that you run it from php script on a web server. Just remove -t switch Commented Sep 27, 2012 at 3:37