Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <19990504173323.13352.rocketmail@web116.yahoomail.com> Date: Tue, 4 May 1999 10:33:23 -0700 (PDT) From: Earnie Boyd Reply-To: earnie_boyd AT yahoo DOT com Subject: RE: bash 2.0.2 backquoted text includes final carriage return To: Bernard Dautrevaux Cc: cygwin users MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- Bernard Dautrevaux wrote: -8<- > Not sure I can agree :-(; IIRC the sh semantics of command substitution > is to replace the string `cmd` by the standard output from running > "cmd", with the last new-line stripped. It's sh problem to understand > that it is running on Losedows, and that, even if usually the default > should be to open pipes in binary mode to avoid too much problems, in > this case the pipe used to retrieve "cmd" output must be opened (on sh > end at least) in TEXT mode, as we expect it to contain text!... > > So IMNSHO its a genuine bash Losedows-porting bug :-) (and ash also > AFAIK); being forced to cripple all my scripts by kludges like: > HOST=`hostname | tr '[:space:]' ' '` > that only works because, I think, tr is willing to work on binary > streams and thus forces its standard input and output in binary mode :-( > > This work but is both ugly and error prone; the solution should be to > fix bash and ash (and perhaps also tcsh, pdksh and the like...) > > One must never underestimate the time needed to understand exactly how > to set up file modes when porting UNIX code to Losedows; and it's not > always possible to keep the simple 'use the default and let the user > struggle with it' approach. In a shell script some pipes must use the > binary mode default, some must use text mode and I'm not sure that > changing CYGWIN dynamically will do the job for the enclosing shell :-< > > Correct me if I'm wrong, You have your mounted mode settings set to binary mode processing, is this not correct? Suggestion, change them back to text mode processing. I don't have any of these problems. In the default text mode processing, the \r line ending in scripts and bash/ash isn't a problem. As I've stated before, operate in the default mode and the programs that aren't ported properly to handle binary files need to be fixed. Differences between platforms have always been a challenge and will forever be. That not only includes UNIX vs WIN32 vs MSDOS vs VMS vs etc. but also includes different flavors of the "same" operating system such as UNIX BSD or UNIX SYSTEM V or ... === "Earnie Boyd" CYGWIN RELATED HELP: DOCUMENTATION: DLLHELP: ARCHIVE SEARCH: OR _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com