Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Console adds extra line if text reaches console window width

12 views
Skip to first unread message

Huang@discussions.microsoft.com Yong Huang

unread,
Dec 14, 2004, 4:45:05 PM12/14/04
to
I shrink my console windows (DOS box) to 30 characters wide. My script
test.bat has 2 (not 3) lines and contains:
*** Begin cut ***
@echo off
echo 123456789012345678901234567890
*** End cut ***

When I run it, I see:
*** Begin cut ***
C:\>test.bat
123456789012345678901234567890


C:\>
*** End cut ***
Note the two blank lines after the script output.

Now I drop one digit on my echo line in test.bat so it looks like:
echo 12345678901234567890123456789
and run it. I see:
*** Begin cut ***
C:\>test.bat
12345678901234567890123456789

C:\>
*** End cut ***
Now there's only one blank line.

The same happens if I change the console width to 80 and I echo 80 vs. 79
digits. I also tried writing this program in Perl (from ActiveState) and
Python (comes with IBM laptop). It's the same behavior. My console window
text font is Lucida Console, if it matters.

Question: Is there any way to tell Console window not to add the extra line
if the length of the echoed text is the same as the window width?

Yong Huang
yong321 @ yahoo.com

0 new messages