[UPHPU] write contents in variable into remote file
Jeremiah Roth
phh at mac.com
Tue Nov 6 20:39:15 MST 2007
I haven't tested it, but I believe one of the two should work:
echo -e "1\n2\n3" | ssh user at server "cat >/tmpfile" (wouldn't work if
the PHP script wasn't on the machine locally, of course)
or
ssh user at server 'echo -e "1\n2\n3" > /tmp/file'
-Jeremiah
On Nov 6, 2007, at 3:00 PM, Wade Preston Shearer wrote:
> I have a PHP script that I am running from the command line. I have
> a string of text with new line characters in it that I am trying to
> write out into a file on a remote server. Here is what I have so far:
>
> ssh user at server echo -e "1\n2\n3" > /tmp/file
>
>
> It is writing to /tmp/file locally though instead of on the remove
> server.
>
> Also, it is not respecting the new lines. The contents of the file
> are "1n2n3".
>
> What am I doing wrong?
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
More information about the UPHPU
mailing list