NYCPHP Meetup

NYPHP.org

[nycphp-talk] talk Digest, Vol 70, Issue 1

Nicholas Hart pelhamny at gmail.com
Wed Aug 22 19:29:14 EDT 2012


Hi,

Thanks for the help with the telnet issue!  I am now trying to save text to
a file that is going to be placed on a different server.  I planned to use
shell_exec in PHP but cannot seem to get it to work:

shell_exec('echo testdata > file.txt');   - this doesn't work   but
shell_exec('ls > file.txt');    -does work

trying to get  shell_exec('echo '.$str.' > file.txt');   and ultimately:
shell_exec('ssh root at 172.20.8.20 "echo '.$str.' > file.txt" ');

to work but cannot.  Perhaps there is a syntax or escape character issue?
Any help appreciated.

Thanks.
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20120822/ecf26b15/attachment.html>


More information about the talk mailing list