Solved

Batch file to create a web page thru cgi

Posted on 1998-04-20
2
452 Views
Last Modified: 2013-12-25
Setup:  web server residing on NT file server.

Question:
I'm trying to generate a web page using a simple batch file.  However, the problem I'm running into is in echoing a blank line to the webserver after
Content-type: text/html

In Perl, this would be
print "Content-type: text/html\n\n";

In DOS, I'm using
@echo off
echo Content-type: text/html


Now, how do I echo a blank line?  Type echo on a line by itself just echos echo is off.

It seems to me that this question should be really easy, but if it isn't, let me know.

Thanks!
0
Comment
Question by:bigelos
2 Comments
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 50 total points
ID: 1827655
Use the command 'echo.' (echo followed by a period). This will output \n to stdout.

Ths your code is:
@echo off
echo Content-type: text/html
echo.
echo.
echo <html>
...

hope this helps...
\\madduck
0
 
LVL 3

Author Comment

by:bigelos
ID: 1827656
MaDdUCK,

Thanks.  I knew it was something like that, but I had the space between echo and the period, and that wasn't working very good.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question