|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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 >. |
|
#2
|
|||
|
|||
|
Have you tried using quotes?
__________________
-- I'll provide you with reference points; if they dont work, refer to something else. While I've regularly been provided 'working' software that fails to build or work as advertised I've yet to face a Copyright/Warranty/License that isnt exact to the finest detail. Priorities, my friend. Priorities. |
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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> |
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
|||
|
|||
|
Correct I am on windows.
|
|
#7
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Echo html in a batch file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|