How to run bash script from link on webpage?
Hello
I'd like run bash srcript (click on webpage link). So I create new network.protocol-handler.app.bash (value /usr/bin/terminal) in firefox (about:config). Click on link to script (bash:///home/user/moj/echo.bash) And I have firefox error Code:
Firefox doesn't know how to open this address, because the protocol (bash) isn't associated with any program |
Quote:
Just from putting "how to run a script from a webpage" into Google, it pulls up this as the very first hit: http://www.cyberciti.biz/faq/run-she...from-web-page/ |
I don't want php/java. I rather think about something like this:
http://askubuntu.com/questions/16155...a-shell-script |
Web browsers recognize and handle certain MIME types themselves (text/html, image/png, etc, etc.). Those that aren't recognized internally are often handled by plugins (application/pdf, video/mp4, etc, etc.). If no "helper" applications are found you'll be asked to point to one. So, if you mean you want to execute an application based on a protocol (say "magnet://") or a MIME type (application/x-shellscript, text/x-java), then that will work. Maybe you should be specific about what you want to achieve and give an example.
|
Quote:
|
@TB0ne I read. I want start bash script by click link on local web page.
I haven't running web server Code:
ls -la /etc/rc.d/rc.httpd On each of them will put a link that will open an external editor and I can easily edit sources files (.txt). |
Then why not just use a File manager if the files are local, or a Graphical SFTP or FTPS client if they are remote, browse, double click item to open with the editor and be done with it?
|
because I want use firefox and I do not want to get around the problem
|
Quote:
Otherwise, the link I gave you explicitly tells you how to make a bash script work through a web page, and has an example of how to do it. Doesn't get much simpler than that. So, if you did read/understand it, you have an answer. Quote:
|
This
Quote:
|
I edit firefox mimeTypes.rdf (new Type File zz, action sublime-text)
I change extension .txt files on .zz Put in end line: file:///path/file.zz Use asciidoc to create html files. So, then I click on link, text editor open with file.zz :) Now I can quickly and just as I edit the files. Achieved his goal. But I'm wonder how to execute local bash script in firefox something like: bash://path-to-script.bash in url bar. |
See the link TB0ne posted in post #2.
|
Quote:
|
This is off topic, but I vote this thread for the "Best of 2013" award.
|
how to execute/ run a linux commond from HTML page..?
In my project I have to run a unix commond from html page to change my IP address of my target board. can some one suggest me how to achieve this. |
All times are GMT -5. The time now is 03:00 PM. |