Topic: Execute bash script in controller - show response in view
I'm using %x[ ] to run basic linux commands like "top" to display in my rails app.
I need to call a bash script that returns a string and display the string.
I tried this:
@result = %x[ bash.sh ]
...and got nowhere.
I did some Googling and found several examples of folks using PTY and expect...which is alien to me.
So I'm in need of some guidance.
I need to call a bash script in my controller that will return a string, save it as an instance variable and redirect to my view to display that string.
PLEASE help :-)
Last edited by Yak (2008-04-22 11:06:48)