Operating System - HP-UX
1753785 Members
7301 Online
108799 Solutions
New Discussion юеВ

Run shell script from mozilla on unix

 
Mark Lien
Occasional Advisor

Run shell script from mozilla on unix

Hi,
I need to run shell script from the mozilla browser to start a tool on unix. But mozilla gives me an error that the associated helper application is not found. I have tried to set the helper application in preferences, but not working. Please help me with this and also how I should set the application type for executing shell script.
Thankyou
3 REPLIES 3
Mel Burslan
Honored Contributor

Re: Run shell script from mozilla on unix

I am assuming you meant, you have a unix server which is running something like apache web server and you want to run a shell script on this server. Is this right ? If so, this is most probably apache or whichever web server you are running is not allowing executable code running under a unix shell due to security reasons. And I am pretty much sure that perl code is allowed to run as cgi-bin. So, you can put a perl wrapper around your shell script as such :

perl -e '$cc = system("/path/myscript.sh"); exit($cc);'

and put this one liner script into your cgi-bin directory on the server.

HTH
________________________________
UNIX because I majored in cryptology...
Mark Lien
Occasional Advisor

Re: Run shell script from mozilla on unix

Thanks for the reply.
Actually the files are local to the client that the shell script is trying to execute so I thought that giving direct path to the shell script file might work as it does in netscape on Unix and on IE on windows.I have set the helper application too , but the mozilla is giving error. Is this possible what I'm trying to do or should I go for some other solution like perl?
Also the webserver is a windows server and I would have to have Unix server initialized for this.
Please help. Thankyou
Mel Burslan
Honored Contributor

Re: Run shell script from mozilla on unix

although it may sound like an overkill but if this, running the script from a browser window, is a requirement, you may be better off installing an apache instance on this box and use a perl cgi-bin solution.

I have never done what you are trying to do before, so I can not be of more help with the mozilla helper applications, and its being fit for the purpose or not.

Good luck
________________________________
UNIX because I majored in cryptology...