This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

shell back quote expansion problem


I first found this problem with B20, and it still exists in the latest (June
23) binaries
from sourceware.cygnus.com.  It affects both bash and tcsh, and probably
other
shells as well.  It appears when running on both 95 and NT 4.

If I use back-quote expansion on a command from the cygwin package,
everything
works fine.  If I use back-quote expansion on a native Win32 command-line
program
(that prints CR-LF at the end of each line of stdout), the shell expansion
fails.  If
instead of using back quotes, I redirect the output of the native command
into a file
and then use "cat file" in the back quotes, it works.

I found this when I was using the "ct lsco" command, which is part of
Rational's
ClearCase source control package.  Since I can't redistribute that command,
I've
contrived an example that uses only the native NT 4 commands.  Run the
following
commands in a directory with one or more ".h" files.

1. back quote expansion works with cygwin binaries

	ls -l  `ls -1 *.h`

2. back quote expansion works with data from MS-DOS text files

	cmd /c dir /b *.h > hfiles
	ls -l `cat hfiles`

("dump hfiles" will show that each line is terminated with CR-LF.)

3. back quote expansion fails with output from an MS-DOS command

	ls -l `cmd /c dir /b *.h`


Is there some simple workaround or environment setting that I'm missing, or
is this a real bug?

Steve Tarr
Xerox Corp.
Stephen.Tarr@opbu.xerox.com




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]