how to use html tag in shell scripting | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

how to use html tag in shell scripting

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-10-2008
jrex1983 jrex1983 is offline
Registered User
 
Join Date: Nov 2008
Last Activity: 27 December 2008, 12:17 AM EST
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
how to use html tag in shell scripting

Hai friends

I have a small doubt..

how can we use html tag in shell scripting

code :
echo "<html>"
echo "<body>"
echo " welcome to peace world "
echo "</body>"
echo "</html>"

output displayed like this:

<html>
<body>
welcome to peace world
</body>
</html>


but i need output in this format,

" hai ".


i saved the file in .sh format

can any body help me..

thanks

rex
Sponsored Links
    #2  
Old 11-10-2008
danmero danmero is offline Forum Advisor  
 
Join Date: Nov 2007
Last Activity: 12 October 2014, 10:11 AM EDT
Location: H3X
Posts: 2,151
Thanks: 10
Thanked 117 Times in 110 Posts

Code:
echo '<html>
<body>
"welcome to peace world".
</body>
</html>'

Sponsored Links
    #3  
Old 11-11-2008
jrex1983 jrex1983 is offline
Registered User
 
Join Date: Nov 2008
Last Activity: 27 December 2008, 12:17 AM EST
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by danmero View Post
Code:
echo '<html>
<body>
"welcome to peace world".
</body>
</html>'

hai i am not getting thro this code . in this code we get like this only.

<html>
<body>
"hai"
</body>
</html>


can u give some other suggestion
    #4  
Old 11-14-2008
carlos25 carlos25 is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 3 August 2009, 4:45 PM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
HTML is a "Hyper Text" display language and can be only used to display text in a formated manner via a web browser. PHP is the most widely used scripting language and can be used on the command line to produce local results or serve the results to a web browser request via the internet/intranet . i.e. format and display a page viewable with a web browser. However, if you want to serve the html up to web clients you will need to do so via a web server.

You can use the code you supplied but you have to display it with a web browser. The web browser will read the tags and display the contents without displaying the tags.

Simply put - scripts are used to perform tasks and commands and the html tags are used to display results in a formatted fashion with a web broweser.
Sponsored Links
    #5  
Old 11-14-2008
jrex1983 jrex1983 is offline
Registered User
 
Join Date: Nov 2008
Last Activity: 27 December 2008, 12:17 AM EST
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
can u give some example

hai can u give some example


Quote:
Originally Posted by carlos25 View Post
HTML is a "Hyper Text" display language and can be only used to display text in a formated manner via a web browser. PHP is the most widely used scripting language and can be used on the command line to produce local results or serve the results to a web browser request via the internet/intranet . i.e. format and display a page viewable with a web browser. However, if you want to serve the html up to web clients you will need to do so via a web server.

You can use the code you supplied but you have to display it with a web browser. The web browser will read the tags and display the contents without displaying the tags.

Simply put - scripts are used to perform tasks and commands and the html tags are used to display results in a formatted fashion with a web broweser.
Sponsored Links
    #6  
Old 11-17-2008
carlos25 carlos25 is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 3 August 2009, 4:45 PM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
A basic example can be found here PHP in HTML - HTML inside PHP - PHP embed HTML


Code:
<html>
<title>HTML with PHP</title>
<body>
<h1>My Example</h1>

<?php
//your php code here
?>

<b>Here is some more HTML</b>

<?php
//more php code
?>


</body>
</html>

You can remove the php script and generate a html page by using echo or print on each line with a bash or ksh script and then open the doc with a web browser to view the document.
FYI - The php script won't work unless it's on a webserver.

Last edited by carlos25; 11-17-2008 at 08:21 PM..
Sponsored Links
Closed Thread

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
Having problem with how to use HTML in Unix shell scripting anand.aswini Shell Programming and Scripting 2 05-09-2012 01:43 PM
How to generate html reports through LINUX Scripting? dsfreddie UNIX for Dummies Questions & Answers 6 04-09-2012 11:40 AM
Call Shell scripting from Perl Scripting. anupdas Shell Programming and Scripting 2 02-12-2010 07:07 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 08:12 AM



All times are GMT -4. The time now is 09:03 AM.