This is the mail archive of the cygwin 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]
Other format: [Raw text]

RE: echo "$(echo '\r')" oddity

socat ( is a multi-purpose relay tool
that can be used to connect sockets to pipes and vice versa, or terminal
pty's to TCP sockets etc etc. I have found it a very handy tool to build
VPN-like things in a environment where you cannot or do not want to modify
the existing networking infrastructure. 

The socat code comes with a test script for testing socat functionality.
Prior to upgrading to cygwin 1.5.16 almost all socat options were functional
under cygwin, except for a few that used the 'exec:'parameter. An example of
a command that is failing is:
  ./socat -t 0.1 exec:'openssl s_server -accept 12002 -quiet -cert
testsrv.pem' pipe &
  echo hallo | ./socat -t0.1  - openssl:localhost:12002,verify=0 

this command runs fine on Linux but under Cygwin there is no output echoed
back from the openssl s_server application. More specifically, the socat
server process (first line) does return the output but it looks like the
output never reaches the client - to me, that sounds like a pipe flushing
problem or a line-termination problem. 

the command that I reported yesterday:
  echo "$(echo '\r')"
is now working under a newly-compiled version of bash 3.0 in which I
commented out the offending section in subst.c.

An interesting note is that after I upgraded to cygwin 1.5.16 (from 1.5.14)
yesterday) a few other options ALSO stopped working. I am not sure what has
caused this.


JJ Keijser

> -----Original Message-----
> From: 
> [] On Behalf Of Brian Dessent
> Sent: Tuesday, May 03, 2005 17:54
> To: ''
> Subject: Re: echo "$(echo '\r')" oddity
> Jan Just Keijser wrote:
> > thx for the quick answer. Lemme guess: I am going to have 
> to build my 
> > own version of bash that does not have this behaviour... 
> what is going 
> > to break if I undo this patch from the bash source code?
> > 
> > It's a shame though, coz this seems to be the only issue that stops 
> > that nifty socat from working... all tests pass except those tests 
> > that use `` or
> > $() ...
> My guess is that that patch was added so that command 
> substitution on windows programs works.  Or something to that 
> effect.  You could certainly recompile without it, and see 
> what happens.
> But the question that I think we're left with is what exactly 
> is socat doing that is broken by this?  If you give examples 
> I'm sure someone here will be able to show you a way to do 
> what you want without patching anything.  Note: I have no 
> idea what socat is...
> Brian
> --
> Unsubscribe info:
> Problem reports:
> Documentation:
> FAQ:         

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Unsubscribe info:
Problem reports:

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