Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2006, 05:51 PM
Ronack Ronack is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 301 Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 21 h 21 m 36 sec
Reputation Power: 10
Echo html in a batch file

Hi gang,

I need to echo html markup into a file via my batch file like this
Code:
echo  <center><a href=".....</a></center> >> index.html

Of course there is a lot more to the batch file than this but this is where it breaks. Is there a way to echo html markup into the new index.html?

I suspect that the batch file doesn't like < and >.

Reply With Quote
  #2  
Old March 30th, 2006, 10:33 PM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 989 L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 22 h 45 m 6 sec
Reputation Power: 362
Send a message via AIM to L7Sqr
Have you tried using quotes?
__________________
True happiness is not getting what you want, it's wanting what you've already got.

My Blog

Reply With Quote
  #3  
Old March 31st, 2006, 12:34 PM
cybersaga's Avatar
cybersaga cybersaga is offline
I have a red lunch bag
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jan 2005
Location: The armpit of Niagara
Posts: 3,125 cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 27 m 52 sec
Reputation Power: 338
Using quotes will unfortunately include the quotes in the output. I don't think there is a way you can do this with the echo command.
__________________
Web Design Tips - Posting and You

If I've been helpful, and/or you're really nice, consider buying something from my Amazon.com wishlist.
  • There is no room for pride when trying to be the best at what you do.
  • Friends don't let friends use bad code.
The club is dead.

Reply With Quote
  #4  
Old March 31st, 2006, 01:49 PM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 989 L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level)L7Sqr User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 22 h 45 m 6 sec
Reputation Power: 362
Send a message via AIM to L7Sqr
My file (html_test.sh):
Code:
#!/usr/local/bin/bash
echo "<html><head>Test</head><body><a href=\"www.google.com\">google</a></body></html>" >> out.html


I run:
Code:
./echo_test.sh


I get (out.html):
Code:
<html><head>Test</head><body><a href="www.google.com">google</a></body></html>

Reply With Quote
  #5  
Old March 31st, 2006, 02:03 PM
cybersaga's Avatar
cybersaga cybersaga is offline
I have a red lunch bag
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jan 2005
Location: The armpit of Niagara
Posts: 3,125 cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level)cybersaga User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 27 m 52 sec
Reputation Power: 338
Well, he mentioned he wants to do this in a batch file, so I'm assuming he's on Windows. On Windows, the echo command will include the quotes; at least WinXP.

Reply With Quote
  #6  
Old March 31st, 2006, 03:58 PM
Ronack Ronack is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 301 Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 21 h 21 m 36 sec
Reputation Power: 10
Correct I am on windows.

Reply With Quote
  #7  
Old March 31st, 2006, 05:04 PM
Ronack Ronack is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 301 Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level)Ronack User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 21 h 21 m 36 sec
Reputation Power: 10
A light bulb came on a minute ago and I remembered that I had done this in another script probably 2 years ago and it works.

Here's how to include HTML in a Batch File for output as per my example.
USE THE CARROT
Code:
echo  ^<center^>^<a href="someur.com"^>something^</a^>^</center^> >> index.html

 
Comments on this post
cybersaga agrees: Nice! I knew there had to be something like this, but I couldn't find it. Thanks for posting your
solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Echo html in a batch file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap