LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2013, 06:32 AM   #1
aditimk
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
Terminal should open from html page


Hello all, i have just joined this forum.
There is a question that i need an urgent solution to.
How do i open a terminal from an HTML page?
I need to do this, to open a terminal, and run a bash script.
Please help.
 
Old 02-17-2013, 08:01 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Which distro? And how are you invoking html page?

Well, in order to launch a terminal, you can invoke following cmd(s) on shell:
Code:
~$ gnome-terminal &
OR
~$ xterm &
 
Old 02-17-2013, 11:34 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
There is a question that i need an urgent solution to.
Show us what you have, so far.
 
Old 02-17-2013, 11:36 AM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Some solutions here:

How to run bash script from link on webpage?

Is there some school that's giving homework with this bizarre requirement?

Last edited by dugan; 02-17-2013 at 11:38 AM.
 
Old 02-17-2013, 12:34 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Do you wan the script to run on the browser host, or on the server host? If on the browser host, you will probably (hopefully) find that extremely difficult, or impossible. If a browser permits arbitrary scripts and applications to run on it's host, that represents a security risk of monumental proportion. If the script is to run on the server host, then generic CGI techniques should be present. It will require you to have access to the server in order to create your script, and the sphere of access to the filesystem will probably be quite limited without some significant reconfiguration of the server (and which you should consider very very carefully).

--- rod.
 
Old 03-03-2013, 01:59 AM   #6
aditimk
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Actually, i know the xterm solution, and i have done the same in my bash script. The real problem is in putting a link on an html page, on clicking on which my bash script to open a terminal n run a program should run.
But thank you all for the suggestions. Please suggest something for this. Thanks everyone.
 
Old 03-03-2013, 02:01 AM   #7
aditimk
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
dear Dugan, no homework dear.. Its what i need to do for my project.
 
Old 03-03-2013, 06:59 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
It would be very dangerous security hole.
 
Old 03-03-2013, 11:10 AM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
So, you've reiterated the question. Will you answer the question posed to you? If not, it will be difficult to suggest anything. If your question is so urgent, it would be in your best interest to help those who are trying to help you.

Last edited by theNbomr; 03-03-2013 at 11:12 AM.
 
Old 03-04-2013, 11:59 AM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by NevemTeve View Post
It would be very dangerous security hole.
Well, on the host used to run the web browser one can activate an HTTP server as an independent process which starts running before the web browser. And the server will have a local host IP address, e.g. 127.0.0.0 ad will be listening on some port, say, 8080.

The URL that is supposed to invoke a bash script should point to that local host server and port, e.g., as stated above, 127.0.0.0:8080, and the local server will invoke the needed script. Which can reside, for example, in cgi-bin.

So it won't be just a security hole, it will the needed by design security hole .
 
Old 03-04-2013, 12:18 PM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You need to answer the questions that have been asked of you before anybody can be of any help.

Namely, who is the server, who is the client, and where is this terminal supposed to run? Does it need to be a graphical terminal that actually opens up on the machine (if so, which machine?), or does it just need to run a script on the machine (if so, which machine?)
 
Old 03-04-2013, 12:30 PM   #12
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I read this request differently to others, it seems.
As I read it the OP wants to have HTML files stored locally (probably in a home folder) which contain links to scripts in that folder. One would then click on one off these links and the terminal would open and the script run.
This is something I could see being done under Windows with batch scripts but I wouldn't know how to start under Linux.
 
Old 03-04-2013, 12:45 PM   #13
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by 273 View Post
One would then click on one off these links and the terminal would open and the script run.
This is something I could see being done under Windows with batch scripts but I wouldn't know how to start under Linux.
I just tried this on my Windows box here, Firefox and Chrome just open the bat file as plain text, Internet Explorer asks whether to run or save. Maybe it's possible to configure the browser to run directly, in any case it would be a browser specific rather than OS specific issue.
 
Old 03-04-2013, 12:49 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by ntubski View Post
I just tried this on my Windows box here, Firefox and Chrome just open the bat file as plain text, Internet Explorer asks whether to run or save. Maybe it's possible to configure the browser to run directly, in any case it would be a browser specific rather than OS specific issue.
Yeah, I couldn't be bothered to break out Windows in a VM to try it but I think I have done something similar in the past with IE either file associations of security zones.
I would expect that because, as you say, it could be browser specific, you could tell Firefox to open scripts with the terminal but it would probably rely on setting a file extension or something.
 
Old 05-28-2013, 12:33 AM   #15
amar@solus
LQ Newbie
 
Registered: Mar 2013
Posts: 10
Blog Entries: 1

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html : force the fonts size for whole html page? Xeratul Programming 6 11-27-2012 11:54 AM
[SOLVED] Downloaded complete web page with wget but browser wants internet to open page? SharpyWarpy Linux - General 15 08-16-2012 04:57 AM
How do I output information from a PHP page to an HTML page? SentralOrigin Programming 3 01-10-2009 01:54 AM
open html page and store contents in file from console delmoras Linux - Newbie 2 11-24-2008 08:39 AM
php function to open an html page prabhatsoni Linux - Software 2 06-13-2005 11:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration