bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in cat


From: Cutler, David
Subject: Bug in cat
Date: Wed, 24 Oct 2007 00:16:13 +0000

Hello,

My execution environment is
   CYGWIN_NT-5.1 DCUTLER 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
   (dual core, 2.0 GHz cpu with 2GB ram Compaq NW8440 Laptop)

When I downloaded Cygwin, I specified the use of DOS line terminators.

I found a bug in what I suspect is cat when used with a simple bash shell 
script.

It's common to place a set of names into a file (one name per line) and then 
use a for loop to walk through the list.

For example:

If a file named list contains
a001s2
a002s2
a003s2
a004s2
a005s2
a006s2

And you execute the command:
   for I in `cat list` ; do echo \"${i}\" ; done

The output is
"a001s2
"a002s2
"a003s2
"a004s2
"a005s2
"a006s2

Note that the end quote is missing from the echo statement of the loop iterator.

If you replace cat with more, the script works as expected.

Thanks for all your great work.

-David Cutler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]