Ask questions and share hosting deals.
New here? Register and read our Community Rules. Accounts are approved by hand.
Hey,
Just asking if anybody knows how to automatically print a section of text in SSH onto a website?
Many thanks,
Andrei
do ps to get the process id of ssh or any process you want to capture then go to /proc/PID/fd/
there you will find many files named 0 ,1 etc
one or some of them contains the output of your ssh command
So just output that file in your website
another option is to use tee by piping the command output to tee and let tee write it to a file while showing it on console
then simply output that file in your site
Thanks
You may also just redirect the output from stdout to a file (just place " > output.txt" behind the command) and then get the contents of that text file (in php with file_get_contents, f.e.).
Put a little script together for him. If someone else is interested, it's here: http://content.bitforce.io/let.txt
Comments
do ps to get the process id of ssh or any process you want to capture
then go to
/proc/PID/fd/
there you will find many files named 0 ,1 etc
one or some of them contains the output of your ssh command
So just output that file in your website
another option is to use tee
by piping the command output to tee and let tee write it to a file while showing it on console
then simply output that file in your site
Thanks
You may also just redirect the output from stdout to a file (just place " > output.txt" behind the command) and then get the contents of that text file (in php with file_get_contents, f.e.).
Put a little script together for him. If someone else is interested, it's here: http://content.bitforce.io/let.txt