Subject: Re: RE: problems linking formats.
From: [email-masked] (Chet Ramey)

27 Mar 1997 04:16:41 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Original-To: [email-masked]
Original-Cc: [email-masked]
In-Reply-To: Message from [email-masked] of Tue, 25 Mar 1997 07:58:42 -0800 (id <01BC38F2.5C260D50@DAVIDSANL>)
Read-Receipt-To: [email-masked]
Original-Sender: [email-masked]

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: [email-masked]
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".