Open HTML file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Open HTML file
# 1  
Old 10-04-2011
Open HTML file

Hello,

Is it possible to run/open a HTML File from bash? I mean that when the HTML File contains an alert JavaScript code that then a message box will be shown?

Thanks!
# 2  
Old 10-04-2011
You can open an html file using a browser through the shell. Something like this.

Code:
firefox "your_html_file"

--ahamed
# 3  
Old 10-04-2011
Thanks. But is it possible to run the HTML file in the background? Or just a JavaScript code?
# 4  
Old 10-04-2011
javascript has no meaning outside of a web browser or scripting engine of some sort. You could hack a raw version of spidermonkey to run raw browserless javascript maybe, but it'd be a ton of work, probably wouldn't understand HTML, and likely wouldn't do what you wanted in the end.

bash is not a webpage and will need to steal an awful lot of things from web browsers to act like a webpage. Why not just do what you want, in bash, in the first place?
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Mutt for html body and multiple html & pdf attachments

Hi all: Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project. There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues. Running with... (1 Reply)
Discussion started by: raggmopp
1 Replies

2. Shell Programming and Scripting

Removing all except couple of html tags from html file

I tried to find elegant (or at least simple) way to remove all but couple of html tags from html file, but all examples I found dealt with removing all the tags. The logic of the script would be: - if there is <li> or <ul> on the line, do nothing (=write same line to output) - if there is:... (0 Replies)
Discussion started by: juubuntu
0 Replies

3. Red Hat

Send HTML body and HTML attachment using MUTT command

Hi there.. I need a proper "mutt" command to send a mail with html body and html attachment at a time. Also if possible let me know the other commands to do this task. Please help me.. (2 Replies)
Discussion started by: vickramshetty
2 Replies

4. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

5. UNIX for Advanced & Expert Users

shellinabox/html help to insert a keypress with an html button

I am trying to use shellinabox as a terminal emulator. Everything is working except there seems to be no way to simulate an F14 button press in shellinabox. I am already embedding shellinabox in an html page so Im am wondering if there is a way to make an html/js button that will pass F14 to the... (0 Replies)
Discussion started by: syadnom
0 Replies

6. UNIX for Dummies Questions & Answers

How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part. Same problem happens in "type" command in MS-DOS. I know you can do it by opening it in Internet Explorer,... (4 Replies)
Discussion started by: los111
4 Replies
Login or Register to Ask a Question