🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.misc
Article #2906

Re: Echo command in batch files

#2906
From: Tim Ma
Date: Tue, 17 Nov 1992 18:51
79 lines
3142 bytes
Hi,

To "suppress" the CR/LF in the DOS echo command, try:

echo hello>temp world >> temp

Output should be:
hello world

Seems to work with MSDOS 5.0.

Tim Ma
Associate Programmer
University of Utah
Email:  tim@src.cppa.utah.edu

Original Message below:
-----------------------------------------------------------------------------

In article <1992Nov16.204439.17539@oracle.us.oracle.com> skanga@us.oracle.com (Shiraz Kanga) writes:
>From: skanga@us.oracle.com (Shiraz Kanga)
>Subject: Re: Echo command in batch files
>Date: Mon, 16 Nov 1992 20:44:39 GMT
>
>In article <1992Nov14.190918.9554@oracle.us.oracle.com> skanga@us.oracle.com (Shiraz Kanga) writes:
>>Hi folks
>>
>>Does anyone know how to prevent echo from issuing a CR/LF at the end of a line.
>>
>>Eg : If I create the following file called test.bat
>>
>>echo hello > temp
>>echo world >> temp
>>
>>The result in temp is:
>>hello 
>>world
>>
>>I need the result to be:
>>hello world
>>
>>And yes I know echo hello world will work but what I'm trying to do is
>>concatenate two strings which are output by two different programs and
>>get both onto one line.
>>
>>Please respond by mail and I'll summarize to the net if there's interest.
>>
>>thanks
>>
>>shiraz
>>skanga@oracle.com
>>-- 
>>Shiraz Kanga (skanga@oracle.com) Tel: (415)506-5412 Fax: (415)506-7822
>>Analyst -- Desktop Tools Group -- Worldwide Technical Support -- 3OP11
>>Oracle Corporation 500 Oracle Pkwy, MS 659311, Redwood Shores CA 94065
>>"I work for Oracle - I speak and type (over here at least) for myself"
>
>Well folks, as promised heres my summary (since there was little interest)
>
>Some people suggested using external echo commands (xecho, etc) which are
>available for anonymous ftp from various sites. This is not useful for me
>since I am not using echo only.
>
>Another person suggested trying an embedded backspace which might erase the
>CR/LF characters in the file. I did try this before posting and could not get
>it to work.
>
>The most useful suggestion was to concatenate the strings in the dos environment
>and then output the variable to a text file. I will try this (albeit clumsy)
>method as soon as I have the time.
>
>Thanks for the replies
>
>Shiraz
>-- 
>Shiraz Kanga (skanga@oracle.com) Tel: (415)506-5412 Fax: (415)506-7822
>Analyst -- Desktop Tools Group -- Worldwide Technical Support -- 3OP11
>Oracle Corporation 500 Oracle Pkwy, MS 659311, Redwood Shores CA 94065
>"I work for Oracle - I speak and type (over here at least) for myself"
Technical Details
Message-ID: <tim.12.722026318@tim.src.utah.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!news.byu.edu!ux1!fcom.cc.utah.edu!tim.src.utah.edu!tim
References: <1992Nov14.190918.9554@oracle.us.oracle.com> <1992Nov16.204439.17539@oracle.us.oracle.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!news.byu.edu!ux1!fcom.cc.utah.edu!tim.src.utah.edu!tim
From: tim@tim.src.utah.edu (Tim Ma)
Subject: Re: Echo command in batch files
Message-ID: <tim.12.722026318@tim.src.utah.edu>
Lines: 79
Sender: news@fcom.cc.utah.edu
Organization: University of Utah
References: <1992Nov14.190918.9554@oracle.us.oracle.com> <1992Nov16.204439.17539@oracle.us.oracle.com>
Date: Tue, 17 Nov 1992 18:51:58 GMT