How to execute shell script in Firefox Linux web browser

How to execute shell script in Firefox Linux web browser

am 10.04.2008 03:52:02 von lalo

I am having a problem with Firefox for Linux version 2.0.0.6

When my HTML application calls shell file to execute (just to echo
some information) Firefox and Linux ask me what application I want to
run with it
(" You have chosen to open .sh which is a : shell script from /
srv/www/cgi-bin.
What should Firefox do with this file?")

I just want to display echo on Firefox web browser main window.

What should I do ?


My Apach eis running, my files are 755 mode and in directory /srv/www/
cgi-bin, so it should be fine.

Thx in advance,
Lalo

Re: How to execute shell script in Firefox Linux web browser

am 10.04.2008 07:16:45 von Dan Stromberg

On Wed, 09 Apr 2008 18:52:02 -0700, Lalo wrote:

> I am having a problem with Firefox for Linux version 2.0.0.6
>
> When my HTML application calls shell file to execute (just to echo some
> information) Firefox and Linux ask me what application I want to run
> with it
> (" You have chosen to open .sh which is a : shell script from /
> srv/www/cgi-bin.
> What should Firefox do with this file?")
>
> I just want to display echo on Firefox web browser main window.
>
> What should I do ?
>
>
> My Apach eis running, my files are 755 mode and in directory /srv/www/
> cgi-bin, so it should be fine.
>
> Thx in advance,
> Lalo

Check out apache's mime.types file.

On an openSUSE 10.3 system, it lives at /etc/apache/mime.types.

If it's not there, try:

su
find / -name mime.types -print

You may have to restart apache after changing this file.

You could probably change the association for "sh" files to text/plain

ISTR that sometimes firefox (or was it mozilla?) will cache mime type
data pretty tenaciously... You may need shift-reload, or even to clear
your cache. Or just use a new browser of a different kind - like
konqueror - not permanently, just long enough to see what happens with
data that isn't yet cached.

Re: How to execute shell script in Firefox Linux web browser

am 11.04.2008 03:46:27 von lalo

On Apr 10, 1:16 am, Dan Stromberg wrote:
> On Wed, 09 Apr 2008 18:52:02 -0700, Lalo wrote:
> > I am having a problem with Firefox for Linux version 2.0.0.6
>
> > When my HTML application calls shell file to execute (just to echo some
> > information) Firefox and Linux ask me what application I want to run
> > with it
> > (" You have chosen to open .sh which is a : shell script from /
> > srv/www/cgi-bin.
> > What should Firefox do with this file?")
>
> > I just want to display echo on Firefox web browser main window.
>
> > What should I do ?
>
> > My Apach eis running, my files are 755 mode and in directory /srv/www/
> > cgi-bin, so it should be fine.
>
> > Thx in advance,
> > Lalo
>
> Check out apache's mime.types file.
>
> On an openSUSE 10.3 system, it lives at /etc/apache/mime.types.
>
> If it's not there, try:
>
> su
> find / -name mime.types -print
>
> You may have to restart apache after changing this file.
>
> You could probably change the association for "sh" files to text/plain
>
> ISTR that sometimes firefox (or was it mozilla?) will cache mime type
> data pretty tenaciously... You may need shift-reload, or even to clear
> your cache. Or just use a new browser of a different kind - like
> konqueror - not permanently, just long enough to see what happens with
> data that isn't yet cached.

I went to web site :
http://www.cyberciti.biz/faq/run-shell-script-from-web-page/

and I renamed my .sh file to .cgi.

And it is much better.

I can try what you suggested as well.

Thank yo for your help.