delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/08/26/20:45:40

From: eholter AT newpointtech DOT com (Eric Holter)
Subject: B19: bug in bash.exe using backquote to capture stdout
26 Aug 1998 20:45:40 -0700 :
Message-ID: <35E40D67.A261C431.cygnus.gnu-win32@newpointtech.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

hello,
i recently found that when using bash.exe to run a shell script, the
backquote-stdout-capturing mechanism leaves carriage-return characters
in the variable.  for example, i have some console utilities which use
the combination of <cr> and <lf> to indicate a newline.  suppose this
utility is called 'myprog.exe' and running it simply outputs the
characters 'hello world<cr>'.  if, within a bash.exe shell script i do
something like
        MYVAR = `myprog`
i find that the <cr> carriage return is not stripped out and is
contained in the variable MYVAR.  thus doing something like
        echo ${MYVAR}boing
i would expect to see 'hello world boing', but instead i see '
boingworld'.

thanks,
  eric holter
  newpoint technologies, inc.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019