bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read and env variables + POSIX => SEGFAULT


From: Greg Wooledge
Subject: Re: read and env variables + POSIX => SEGFAULT
Date: Tue, 13 Oct 2015 08:11:30 -0400
User-agent: Mutt/1.4.2.3i

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]