Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Why are here no line feeds/CRs ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  19 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jochen Berninger  
View profile  
 More options May 20 2008, 4:49 pm
Newsgroups: comp.unix.shell, comp.unix.questions, comp.os.linux.misc
Followup-To: comp.os.linux.misc
From: buz...@hotmail.com (Jochen Berninger)
Date: 20 May 2008 20:49:35 GMT
Local: Tues, May 20 2008 4:49 pm
Subject: Why are here no line feeds/CRs ?
When I issue the following command then the output is concatenated as ONE (!) very long line.
No CR/line feeds split the output into multiple lines as usual.

Whats wrong?

echo `date; ls -l; date` >>filelist.txt

Jochen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mickey  
View profile  
 More options May 20 2008, 4:57 pm
Newsgroups: comp.os.linux.misc
From: Mickey <mic...@perusion.net>
Date: Tue, 20 May 2008 15:57:09 -0500
Local: Tues, May 20 2008 4:57 pm
Subject: Re: Why are here no line feeds/CRs ?
On 2008-05-20, Jochen Berninger <buz...@hotmail.com> wrote:

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

You are echoing words processed by the shell, not outputting
commands. Do instead:

  (date; ls -l; date) >> filelist.txt

--
Mickey
{((>:o}~  <<<<Oh look!!! An idolatrous image of the prophet!!! Surely
we must now avenge this blasphemy by burning down the world!!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Morton  
View profile  
 More options May 20 2008, 5:02 pm
Newsgroups: comp.os.linux.misc
From: Ed Morton <mor...@lsupcaemnt.com>
Date: Tue, 20 May 2008 16:02:07 -0500
Local: Tues, May 20 2008 5:02 pm
Subject: Re: Why are here no line feeds/CRs ?
On 5/20/2008 3:49 PM, Jochen Berninger wrote:

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

Nothing.

> echo `date; ls -l; date` >>filelist.txt

You're calling echo with multiple arguments (i.e. all the text output by the
other commands) and it's printing them one at a time with a space between each
just as it's supposed to. If that's not what you want, do either of these:

{ date; ls -l; date; } >>filelist.txt

echo "`date; ls -l; date`" >>filelist.txt

the first one being preferable.

        Ed.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Edwards  
View profile  
 More options May 20 2008, 5:02 pm
Newsgroups: comp.os.linux.misc
From: Grant Edwards <gra...@visi.com>
Date: Tue, 20 May 2008 16:02:22 -0500
Local: Tues, May 20 2008 5:02 pm
Subject: Re: Why are here no line feeds/CRs ?
On 2008-05-20, Jochen Berninger <buz...@hotmail.com> wrote:

> When I issue the following command then the output is
> concatenated as ONE (!) very long line. No CR/line feeds split
> the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

Nothing is wrong.

Quoting from the Bash manual:

3.5.4 Command Substitution
--------------------------

  Command substitution allows the output of a command to
  replace the command itself.  Command substitution occurs when
  a command is enclosed as follows:

     $(COMMAND)
   or
     `COMMAND`

  Bash performs the expansion by executing COMMAND and
  replacing the command substitution with the standard output
  of the command, with any trailing newlines deleted.  Embedded
  newlines are not deleted, but they may be removed during word
  splitting.  The command substitution $(cat FILE)' can be
  replaced by the equivalent but faster $(< FILE)'.

  When the old-style backquote form of substitution is used,
  backslash retains its literal meaning except when followed by
  $', `', or \'. The first backquote not preceded by a
  backslash terminates the command substitution.  When using
  the $(COMMAND)' form, all characters between the parentheses
  make up the command; none are treated specially.

  Command substitutions may be nested.  To nest when using the
  backquoted form, escape the inner backquotes with
  backslashes.

  If the substitution appears within double quotes, word
  splitting and filename expansion are not performed on the
  results.

Take note where it says " Embedded newlines are not deleted,
but they may be removed during word splitting".  When the
command line is parsed into arguments to be passed to echo, the
newlines are removed along with other whitespace between words.

You can get the results you seem to want by doing this:

 (date; ls -l; dat) >>filelist.txt

or this:

 echo "`date; ls -l; date`" >>filelist.txt

--
Grant Edwards                   grante             Yow! If I am elected no one
                                  at               will ever have to do their
                               visi.com            laundry again!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Gordon  
View profile  
 More options May 20 2008, 5:06 pm
Newsgroups: comp.os.linux.misc
From: John Gordon <gor...@panix.com>
Date: Tue, 20 May 2008 21:06:58 +0000 (UTC)
Local: Tues, May 20 2008 5:06 pm
Subject: Re: Why are here no line feeds/CRs ?
In <4833395f$0$6503$9b4e6...@newsspool4.arcor-online.net> buz...@hotmail.com (Jochen Berninger) writes:

> When I issue the following command then the output is concatenated as
> ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.
> Whats wrong?
> echo `date; ls -l; date` >>filelist.txt

Depending on what shell you're using, wrapping the argments to echo
in double-quotes might work, like so:

  echo "`date; ls -l; date`" >>filelist.txt

But really, using "echo" is just complicating the issue.  Is there any
special reason you're not just executing the commands directly, like so?

 date  >> filelist.txt
 ls -l >> filelist.txt
 date  >> filelist.txt

And I'm curious -- why are you posting under different names?  That
usually indicates someone who's up to no good.

--
John Gordon                   A is for Amy, who fell down the stairs
gor...@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Janis  
View profile  
 More options May 20 2008, 5:12 pm
Newsgroups: comp.os.linux.misc
From: Janis <janis_papanag...@hotmail.com>
Date: Tue, 20 May 2008 14:12:12 -0700 (PDT)
Local: Tues, May 20 2008 5:12 pm
Subject: Re: Why are here no line feeds/CRs ?
On 20 Mai, 23:49, buz...@hotmail.com (Jochen Berninger) wrote:

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

Nothing is wrong; the command substitution `...` resp. $(...) works as
designed.

> echo `date; ls -l; date` >>filelist.txt

  { date; ls -l; date; } >>filelist.txt

Janis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wenhua Zhao  
View profile  
 More options May 20 2008, 5:51 pm
Newsgroups: comp.os.linux.misc
From: Wenhua Zhao <whz...@gmail.com>
Date: Tue, 20 May 2008 14:51:59 -0700
Local: Tues, May 20 2008 5:51 pm
Subject: Re: Why are here no line feeds/CRs ?

buz...@hotmail.com (Jochen Berninger) writes:

Hi,

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

It seems that echo eats all the LF.  The following should work:

(data; ls -l; data) >> filelist.txt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Marcum  
View profile  
 More options May 20 2008, 5:57 pm
Newsgroups: comp.os.linux.misc
From: Bill Marcum <marcumb...@bellsouth.net>
Date: Tue, 20 May 2008 17:57:09 -0400
Local: Tues, May 20 2008 5:57 pm
Subject: Re: Why are here no line feeds/CRs ?
On 2008-05-20, Jochen Berninger <buz...@hotmail.com> wrote:

> When I issue the following command then the output is concatenated as
> ONE (!) very long line. No CR/line feeds split the output into
> multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

> Jochen

You can either enclose the backquotes in double quotes, or eliminate them:

echo "`date; ls -l; date`" >>filelist.txt
{ date; ls -l; date; } >>filelist.txt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Unruh  
View profile  
 More options May 20 2008, 6:31 pm
Newsgroups: comp.os.linux.misc
From: Unruh <unruh-s...@physics.ubc.ca>
Date: Tue, 20 May 2008 22:31:00 GMT
Subject: Re: Why are here no line feeds/CRs ?

buz...@hotmail.com (Jochen Berninger) writes:
>When I issue the following command then the output is concatenated as ONE (!) very long line.
>No CR/line feeds split the output into multiple lines as usual.
>Whats wrong?
>echo `date; ls -l; date` >>filelist.txt

because ls -l splits up the line according the (non-esitant ) terminal.

Try
(date;ls -l; date)>>filelist.txt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mop2  
View profile  
 More options May 20 2008, 7:16 pm
Newsgroups: comp.os.linux.misc
From: mop2 <inva...@mail.address>
Date: Tue, 20 May 2008 20:16:51 -0300
Local: Tues, May 20 2008 7:16 pm
Subject: Re: Why are here no line feeds/CRs ?
On Tue, 20 May 2008 17:49:35 -0300, Jochen Berninger <buz...@hotmail.com>  
wrote:

> When I issue the following command then the output is concatenated as  
> ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

> Jochen

You need quotes to preserve control characters, LF for example:
echo "`date; ls -l; date`"

Or you can do:
{ date; ls -l; date;}


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maxwell Lol  
View profile  
 More options May 20 2008, 9:43 pm
Newsgroups: comp.os.linux.misc
From: Maxwell Lol <nos...@com.invalid>
Date: 20 May 2008 21:43:12 -0400
Local: Tues, May 20 2008 9:43 pm
Subject: Re: Why are here no line feeds/CRs ?

buz...@hotmail.com (Jochen Berninger) writes:
> When I issue the following command then the output is concatenated
> as ONE (!) very long line.  No CR/line feeds split the output into
> multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

> Jochen

That's what `.....` does. You want

        (date; ls -l; date) >>filelist.txt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Edwards  
View profile  
 More options May 20 2008, 11:13 pm
Newsgroups: comp.os.linux.misc
From: Grant Edwards <gra...@visi.com>
Date: Tue, 20 May 2008 22:13:30 -0500
Local: Tues, May 20 2008 11:13 pm
Subject: Re: Why are here no line feeds/CRs ?
On 2008-05-20, Unruh <unruh-s...@physics.ubc.ca> wrote:

>>When I issue the following command then the output is
>>concatenated as ONE (!) very long line. No CR/line feeds split
>>the output into multiple lines as usual.

>>Whats wrong?

>>echo `date; ls -l; date` >>filelist.txt

> because ls -l splits up the line according the (non-esitant ) terminal.

No, that's not why.

The "ls" command is outputting newlines. The newlines are
discarded by the shell as it splits the output of the three
commands into words before passing them to echo in an argv
vector.

--
Grant Edwards                   grante             Yow!  Is this my STOP??
                                  at              
                               visi.com            


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options May 21 2008, 12:08 am
Newsgroups: comp.os.linux.misc
From: Barry Margolin <bar...@alum.mit.edu>
Date: Wed, 21 May 2008 00:08:03 -0400
Local: Wed, May 21 2008 12:08 am
Subject: Re: Why are here no line feeds/CRs ?
In article <4833395f$0$6503$9b4e6...@newsspool4.arcor-online.net>,
 buz...@hotmail.com (Jochen Berninger) wrote:

> When I issue the following command then the output is concatenated as ONE (!)
> very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

> Jochen

When you don't quote the backtick expression, word splitting is
performed on the result, which causes all whitespace sequences to be
translated to a space.  Try:

echo "`date; ls -l; date`" >>filelist.txt

But why use echo at all?  Why not:

{ date; ls -l; date; } >>filelist.txt

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joachim Schmitz  
View profile  
 More options May 21 2008, 2:21 am
Newsgroups: comp.os.linux.misc
From: "Joachim Schmitz" <nospam.j...@schmitz-digital.de>
Date: Wed, 21 May 2008 08:21:34 +0200
Local: Wed, May 21 2008 2:21 am
Subject: Re: Why are here no line feeds/CRs ?
Jochen Berninger wrote:
> When I issue the following command then the output is concatenated as
> ONE (!) very long line. No CR/line feeds split the output into
> multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

use
(date; ls -l; date) >>filelist.txt

> Jochen

Bye, Jojo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adrian Davis  
View profile  
 More options May 21 2008, 4:00 am
Newsgroups: comp.os.linux.misc
From: Adrian Davis <adr...@satisoft.com>
Date: Wed, 21 May 2008 01:00:55 -0700 (PDT)
Local: Wed, May 21 2008 4:00 am
Subject: Re: Why are here no line feeds/CRs ?

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

Try...

echo "`date; ls -l; date`" >> filelist.txt

Best Regards,
   =Adrian=


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maxwell Lol  
View profile  
 More options May 21 2008, 7:50 am
Newsgroups: comp.os.linux.misc
From: Maxwell Lol <nos...@com.invalid>
Date: 21 May 2008 07:50:38 -0400
Local: Wed, May 21 2008 7:50 am
Subject: Re: Why are here no line feeds/CRs ?

buz...@hotmail.com (Jochen Berninger) writes:

After reading 10+ idential replies (including my own, as I don't
subscribe to this newsgroup), is seems to me that setting the
follow-up to a single newsgroup will cause redundant answers, as we
don't see what others post before we reply.

Sigh... The manual pages provides all the answers you need - and faster too.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Edwards  
View profile  
 More options May 21 2008, 10:06 am
Newsgroups: comp.os.linux.misc
From: Grant Edwards <gra...@visi.com>
Date: Wed, 21 May 2008 09:06:06 -0500
Local: Wed, May 21 2008 10:06 am
Subject: Re: Why are here no line feeds/CRs ?
On 2008-05-21, Maxwell Lol <nos...@com.invalid> wrote:

> After reading 10+ idential replies (including my own, as I
> don't subscribe to this newsgroup), is seems to me that
> setting the follow-up to a single newsgroup will cause
> redundant answers, as we don't see what others post before we
> reply.

That's mainly just due to the latency inherent in Usenet.

> Sigh... The manual pages provides all the answers you need -
> and faster too.

Usually -- if you know which man page to look at. :)

--
Grant Edwards                   grante             Yow! I'm totally DESPONDENT
                                  at               over the LIBYAN situation
                               visi.com            and the price of CHICKEN
                                                   ...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew  
View profile  
 More options May 21 2008, 10:37 am
Newsgroups: comp.os.linux.misc, comp.unix.questions, comp.unix.shell
From: Andrew <andr...@sdf.lonestar.org>
Date: Wed, 21 May 2008 07:37:32 -0700 (PDT)
Local: Wed, May 21 2008 10:37 am
Subject: Re: Why are here no line feeds/CRs ?
On 21 May, 15:06, Grant Edwards <gra...@visi.com> wrote:

> On 2008-05-21, Maxwell Lol <nos...@com.invalid> wrote:

> > After reading 10+ idential replies (including my own, as I
> > don't subscribe to this newsgroup), is seems to me that
> > setting the follow-up to a single newsgroup will cause
> > redundant answers, as we don't see what others post before we
> > reply.

> That's mainly just due to the latency inherent in Usenet.

No, what he is referring to here is the followup-to: header.  I read
this message in comp.unix.shell and no responses are in that group so
it is easy to assume that there have been none.  I only noticed the
header when my newsreader asked me if I wanted to post my carefully
composed response to comp.os.linux.misc as the poster requested did it
occur to me that there may have already been some responses.  Mosey
over to Google groups to check the thread there and I see all the
previous posts that didn't go to comp.unix.shell and
comp.unix.questions.

Setting Followup-to: in this manner is a good way of wasting
everyone's time because the replies _are_ invisible to many readers
who will quite naturally assume that the post has received no
responses and so compose their own.  And as has been noted, the group
that is the target of the header is swamped with several identical
posts.  It is for this very reason that I ignore the header and
respond to all groups.  You will notice I have added back
comp.unix.shell and comp.unix.questions to this post so that hopefully
no-one else needs to waste their time replying.

For a simple query like this there isn't really any need to cross post
among multiple groups anyway.

--
Andrew Smallshaw
andr...@sdf.lonestar.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
#! /shell/nerd  
View profile  
 More options May 21 2008, 11:56 am
Newsgroups: comp.os.linux.misc
From: "#! /shell/nerd" <vikas...@gmail.com>
Date: Wed, 21 May 2008 08:56:58 -0700 (PDT)
Local: Wed, May 21 2008 11:56 am
Subject: Re: Why are here no line feeds/CRs ?
On May 20, 3:49 pm, buz...@hotmail.com (Jochen Berninger) wrote:

> When I issue the following command then the output is concatenated as ONE (!) very long line.
> No CR/line feeds split the output into multiple lines as usual.

> Whats wrong?

> echo `date; ls -l; date` >>filelist.txt

> Jochen

Try -

(date; ls -l; date) >> filelist.txt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »