This is the mail archive of the 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]

Re: RE: problems linking formats.

You know, you should really insert newlines into your mail messages.

> i wanted to chime in here with a note about the particular bash [bug|misfeature] that i'm seeing, under both win95 and nt40:  on the bash that i have on netcom (sorry, can't check the version # of it right now), the following:
> % echo foo > out
> % echo bar >> out
> % export TESTVAR=`cat out`
> sets TESTVAR to simply "foo".  on b17.1, i'm getting
> "foo
> bar"
> instead.

The latter value is correct.  Since you don't have the version of bash
that's running on netcom, it's possible that this was a bug fixed in
a more current version of bash.  Bash versions 1.14.6 and 1.14.7 get
this right.

>oh, and one other thing, which i'm
>sure must be a FAQ, but again, i can't find the answer to--how do i
>stop bash from requiring a /tmp dir for the temp files produced by
>"cat <<EOF"?  no amount of environment var fiddling seemed to save me... 

Bash, as it stands today, requires /tmp.  There are a couple of things
you could do to change it, both requiring modifications to execute_cmd.c.

The easier of the two is to change the code in do_redirection_internal
that handles redirections of types `r_reading_until' and
`r_deblank_reading_until' to look for and use, if found, the value of
a `TMPDIR' variable instead of /tmp, defaulting to /tmp if TMPDIR is
not set.

The second, somewhat more complex, approach is to dispense with a temp
file altogether and use a pipe.  Bash would create a pipe and fork a child.
The child would close the read end of the pipe and stuff the text of
the here document into the write end.  The parent would close the write
end, dup the read end of the pipe to file descriptor 0 for the `cat'
process, and close the read end.

``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, Case Western Reserve University	Internet: chet@po.CWRU.Edu
For help on using this list, send a message to
"" with one line of text: "help".

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