Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

How is html code read, compared to say python?

Shell Programming and Scripting


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-10-2017   -   Original Discussion by SkySmart
SkySmart's Unix or Linux Image
SkySmart SkySmart is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 14 January 2018, 11:38 AM EST
Posts: 907
Thanks: 748
Thanked 3 Times in 3 Posts
How is html code read, compared to say python?

so, the first line of bash, perl, python, ruby, and similar languages must contain the path to the interpreter...i.e. #!/bin/perl, or #!/bin/python. so in the case of a perl script, for instance, a perl script cannot and will never run if the perl program is not installed/present on the system. same thing with python and others.

now, im curious, how is html code being read? what program on the system (let's assume its a Unix system) must exist for an html page to be read and processed?
Sponsored Links
    #2  
Old Unix and Linux 12-10-2017   -   Original Discussion by SkySmart
jgt's Unix or Linux Image
jgt jgt is offline Forum Advisor  
Registered User
 
Join Date: Apr 2007
Last Activity: 22 January 2018, 9:26 AM EST
Location: 44.21.48N 80.50.15W
Posts: 2,029
Thanks: 2
Thanked 278 Times in 260 Posts
By a web server. Apache on most Linux/Unix systems, and IIS (Internet Information Server) on Microsoft operating systems.
You can also open an html file with a web browser if you have read access to the file.
Sponsored Links
    #3  
Old Unix and Linux 12-11-2017   -   Original Discussion by SkySmart
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 January 2018, 8:07 AM EST
Location: Asia pacific region
Posts: 14,293
Thanks: 960
Thanked 1,319 Times in 629 Posts
HTML is “read” by parsing the markup language based on standards and rendering ths results.
    #4  
Old Unix and Linux 12-11-2017   -   Original Discussion by SkySmart
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 January 2018, 8:07 AM EST
Location: Asia pacific region
Posts: 14,293
Thanks: 960
Thanked 1,319 Times in 629 Posts
Also, web servers like Apache2 and ISS process HTTP , transferring (not processing) HTML.
Sponsored Links
    #5  
Old Unix and Linux 12-11-2017   -   Original Discussion by SkySmart
apmcd47's Unix or Linux Image
apmcd47 apmcd47 is offline
Registered User
 
Join Date: Feb 2011
Last Activity: 23 January 2018, 4:11 AM EST
Posts: 294
Thanks: 13
Thanked 80 Times in 77 Posts
Quote:
Originally Posted by SkySmart View Post
so, the first line of bash, perl, python, ruby, and similar languages must contain the path to the interpreter...i.e. #!/bin/perl, or #!/bin/python. so in the case of a perl script, for instance, a perl script cannot and will never run if the perl program is not installed/present on the system. same thing with python and others.

now, im curious, how is html code being read? what program on the system (let's assume its a Unix system) must exist for an html page to be read and processed?
Are you talking about in the context of a file manager? So you go into a folder and you can see by the icons that you have a perl script, or a python script, or an html file; and clicking on the icon will run the script or open the html file in a browser?

Andrew
Sponsored Links
    #6  
Old Unix and Linux 12-11-2017   -   Original Discussion by SkySmart
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 January 2018, 8:07 AM EST
Location: Asia pacific region
Posts: 14,293
Thanks: 960
Thanked 1,319 Times in 629 Posts
Actually, SkySmart was asking about the Shebang in scripts and comparing to HTML.

However, some of the things SkySmart said were not true, for example: "the first line of bash, perl, python, ruby, and similar languages must contain the path to the interpreter"...

This is not always true, as I can easily execute a PHP script from the command line by calling:



Code:
php filename.php

and the path to the interpreter is not required to execute the code. The same is true for most scripts when executed directly.
Sponsored Links
    #7  
Old Unix and Linux 12-11-2017   -   Original Discussion by SkySmart
dodona's Unix or Linux Image
dodona dodona is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 23 January 2018, 2:51 AM EST
Posts: 18
Thanks: 53
Thanked 2 Times in 2 Posts
HTML isn't a scripting language. It's not a programming language, but a markup language 'a system for annotating a document in a way that is syntactically distinguishable from the text' (see wikipedia). Therefor a shebang doesn't make any sense.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need python script to read a file mohtashims Shell Programming and Scripting 4 09-21-2016 06:50 PM
**python** unable to read the background color in python giridhar276 Shell Programming and Scripting 1 08-05-2014 03:53 AM
Read html attachment Neethu Shell Programming and Scripting 1 09-18-2012 05:55 AM
Read html and get specific value hakermania Shell Programming and Scripting 3 01-07-2012 12:49 AM
Python, HTML, and Unix davidfrank UNIX for Advanced & Expert Users 1 05-16-2007 08:28 AM



All times are GMT -4. The time now is 06:18 AM.