There's a requirement in my project to execute interactive shell scripts remotely through a web GUI. This means that stuff printed to the standard output of the script has to be made available on the GUI, and the user input has to be taken from the GUI and written to the standard input of the script.
My questions are (a) Is this is a good idea (setting aside for the moment the fact that it is a requirement)? (b) Has anybody solved this kind of problem before? If yes, what's the 'best' way to go about it?
EDIT #1: The scripts to be executed are not located on the same host as the web server.
EDIT #2:
Thanks for your responses! I'm afraid that browser-side solutions won't fit my purpose because the user can start off one or more scripts, could close the browser, come back after sometime to check on the scripts' outputs and provide input.
The design I've come up with involves storing the output of the scripts to different files and when the user fires up the browser it starts to read from the files and keeps polling it (via Ajax) until the scripts have finished executing.