Deutsch   English   Français   Italiano  
<vg2snp$36bh5$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lem Novantotto <Lem@none.invalid>
Newsgroups: comp.unix.shell
Subject: Re: Using << and an output pipe together in shell (bash)
Date: Fri, 1 Nov 2024 15:39:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <vg2snp$36bh5$1@dont-email.me>
References: <vg0q7d$3tlel$2@news.xmission.com> <87r07v99wd.fsf@bsb.me.uk>
	<vg12fg$3tq77$1@news.xmission.com> <vg18jc$2tv5s$1@dont-email.me>
	<vg25cr$3uc49$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 01 Nov 2024 16:39:37 +0100 (CET)
Injection-Info: dont-email.me; posting-host="a88e548459fc226e0e66a7d936d8e0ba";
	logging-data="3354149"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+almLQZN/RYerXMEzmtWTggh/m2RtoWa0="
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:OfwXxdHY+FJZWaQjNR/qacJDG1k=
Bytes: 2612

Il Fri, 1 Nov 2024 09:01:15 -0000 (UTC), Kenny McCormack ha scritto:

> I think I actually prefer to stick with; > >(cmd ...)

Note that

cat << EOF | grep . ; echo end

and also

(cat | grep .) << EOF ; echo end

produce the same output:
---------------------------------------------------------
lem@biggy:~$ cat << EOF | grep . ; echo end
start
EOF
start
end
lem@biggy:~$
---------------------------------------------------------
lem@biggy:~$ (cat | grep .) << EOF ; echo end
> start
> EOF
start
end
lem@biggy:~$
---------------------------------------------------------

Instead with "cat << EOF > >(grep .) ; echo end" the output is 
unpredictable. You can very well get, as usual:
---------------------------------------------------------
lem@biggy:~$ cat << EOF > >(grep .) ; echo end
start
EOF
start
end
lem@biggy:~$
---------------------------------------------------------
OR maybe:
---------------------------------------------------------
lem@biggy:~$ cat << EOF > >(grep .) ; echo end
start
EOF
end
start
lem@biggy:~$
---------------------------------------------------------
OR even, most of the time:
---------------------------------------------------------
lem@biggy:~$ cat << EOF > >(grep .) ; echo end
start
EOF
end
lem@biggy:~$ start [you press ENTER here and get back an empty prompt]

lem@biggy:~$ 
---------------------------------------------------------

So sometimes it's better to be careful. :)
-- 
Bye, Lem