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?

👤 Login to reply

SkySmart SkySmart is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 18 July 2018, 10:22 PM EDT
Posts: 919
Thanks: 757
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
jgt's Unix or Linux Image
jgt jgt is offline Forum Advisor  
Registered User
 
Join Date: Apr 2007
Last Activity: 21 July 2018, 11:07 AM EDT
Location: 44.21.48N 80.50.15W
Posts: 2,081
Thanks: 2
Thanked 296 Times in 271 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
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 July 2018, 12:51 AM EDT
Location: Asia pacific region
Posts: 14,579
Thanks: 1,032
Thanked 1,438 Times in 698 Posts
HTML is “read” by parsing the markup language based on standards and rendering ths results.
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 July 2018, 12:51 AM EDT
Location: Asia pacific region
Posts: 14,579
Thanks: 1,032
Thanked 1,438 Times in 698 Posts
Also, web servers like Apache2 and ISS process HTTP , transferring (not processing) HTML.
Sponsored Links
apmcd47 apmcd47 is offline
Registered User
 
Join Date: Feb 2011
Last Activity: 20 July 2018, 4:05 AM EDT
Posts: 360
Thanks: 16
Thanked 102 Times in 95 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
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 22 July 2018, 12:51 AM EDT
Location: Asia pacific region
Posts: 14,579
Thanks: 1,032
Thanked 1,438 Times in 698 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
dodona's Unix or Linux Image
dodona dodona is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 19 July 2018, 12:05 PM EDT
Posts: 41
Thanks: 105
Thanked 6 Times in 5 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
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:50 PM
**python** unable to read the background color in python giridhar276 Shell Programming and Scripting 1 08-05-2014 02:53 AM
Read html attachment Neethu Shell Programming and Scripting 1 09-18-2012 04:55 AM
Read html and get specific value hakermania Shell Programming and Scripting 3 01-06-2012 11:49 PM
Python, HTML, and Unix davidfrank UNIX for Advanced & Expert Users 1 05-16-2007 07:28 AM



All times are GMT -4. The time now is 12:51 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?