SliTaz SliTaz Forum

You are not logged in.

#1 2011-12-24 08:29:06

romano
Member
Registered: 2011-12-08
Posts: 91

Shell script with Firefox

In firefox for webcal protocol i want to assign shell script as webcal.sh

After assignment Edit-Preferences i just realized firefox cant execute sh file. Is there any idea?

I guess problem is shellscript file in terminal execute with sh command. is it possible to execute without sh command. I mean instead of "sh webcal.sh" i want to execute "webcal.sh"

I guess this one will work my problem.

It works well in xubuntu.

Any idea?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I tried

* chmod +x webcal.sh after that ./webcal.sh --- Doesnt work - sh: ./webcal.sh : notfound

Offline

#2 2011-12-24 12:52:07

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Shell script with Firefox

sh /home/tux/webcal.sh or wherever the script is should work without any problems

and why you want it without sh

Offline

#3 2011-12-24 23:42:07

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Shell script with Firefox

Add [c]#!/bin/sh[/c] to the very top of the script:

[c]#!/bin/sh

what you want it to do here[/c]
Then just chmod +x it. You can even remove the extension .sh if you want to.

What this trick does is tell the command line environment which scripting interface to use to execute the script. It works for perl (#!/usr/bin/perl), python (#!/usr/bin/python), tcl (#!/usr/bin/tclsh8.5) and pretty much any scripting language there is. All you need to do is give the correct path for it to work wink

Offline

#4 2011-12-25 01:54:54

romano
Member
Registered: 2011-12-08
Posts: 91

Re: Shell script with Firefox

You are the best Trixar_za smile

I just missed #!/bin/sh. Firefox can execute webcal.sh with parameters well now smile

Thank you

kultex:

I want to use it, 'Cause in firefox i cant give parameters to protocol as like "sh webcal.sh" Even i typed manual in mimeTypes.rdf

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]