Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11645

Re: read and env variables + POSIX => SEGFAULT

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: read and env variables + POSIX => SEGFAULT
Date 2015-10-13 08:11 -0400
Message-ID <mailman.225.1444738342.7904.bug-bash@gnu.org> (permalink)
References <CAAZkfoJuwe4o1rPQrfB-vxqeAaBX-=9NPWgv2uiOPdHq7L8g+g@mail.gmail.com> <5619D0F1.6080904@tlinx.org> <561C2097.5080808@case.edu> <561C4456.9020308@tlinx.org> <561C44C1.9000004@tlinx.org>

Show all headers | View raw


On Mon, Oct 12, 2015 at 04:39:45PM -0700, Linda Walsh wrote:
> I wasn't sure if it put the "\n" at the end in a 1-line example.

<< and <<< always end with a trailing newline.  This is 100% unavoidable
with that syntax.  If your data stream needs NOT to end with a newline,
then you have to use < <(printf ...).

> Does it also use a tmp file and use process-substitution, or is
> that only when parens are present?

Yes, <<< uses a temp file just like << does.

wooledg@wooledg:~$ (sleep 1; ls -l /dev/fd/0; sleep 10) <<< "a temp string"
lr-x------ 1 wooledg wooledg 64 Oct 13 08:09 /dev/fd/0 -> /tmp/sh-thd-1033352477 (deleted)

One that is opened and then unlinked, as it turns out.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: read and env variables + POSIX => SEGFAULT Greg Wooledge <wooledg@eeg.ccf.org> - 2015-10-13 08:11 -0400

csiph-web