Page 1 of 1
exec command on remote server and store output
Posted: Tue Jan 31, 2012 11:58 am
by dmallia
So basically I need a script to execute the command(either by ssh or php) 'ls -l' but I need to be logged in as root, and than I want to store the output data in a variable $output. Any ideas how to do it?
Re: exec command on remote server and store output
Posted: Tue Jan 31, 2012 12:15 pm
by Celauran
dmallia wrote:So basically I need a script to execute the command(either by ssh or php) 'ls -l' but I need to be logged in as root, and than I want to store the output data in a variable $output. Any ideas how to do it?
This sounds like a bad idea. What is it you're trying to accomplish?
Re: exec command on remote server and store output
Posted: Tue Jan 31, 2012 12:51 pm
by dmallia
well i will be using it mainly for screen not for ls -l. I need to make sure that there is no screen with the same name as the one that is gong to be executed only if there is no screen already with that name.