Deutsch   English   Français   Italiano  
<87r07v99wd.fsf@bsb.me.uk>

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

Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Ben Bacarisse <ben@bsb.me.uk>
Newsgroups: comp.unix.shell
Subject: Re: Using << and an output pipe together in shell (bash)
Date: Thu, 31 Oct 2024 22:37:22 +0000
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <87r07v99wd.fsf@bsb.me.uk>
References: <vg0q7d$3tlel$2@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 31 Oct 2024 23:37:30 +0100 (CET)
Injection-Info: dont-email.me; posting-host="7eabcca1e5b2acef4fd1f9002cd3898a";
	logging-data="3032598"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/IWXJQtekRFA5/ENZQcqiCUaYRfxx5LAg="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:DNTeKP1Xz04rrVBijT4DZHS+j1Q=
	sha1:1mUhzxEoS5NYgOyR78OkTpxzgMk=
X-BSB-Auth: 1.e2eefceef1af6e4625f7.20241031223722GMT.87r07v99wd.fsf@bsb.me.uk
Bytes: 1768

gazelle@shell.xmission.com (Kenny McCormack) writes:

> Consider this code in a bash script:
>
> (Note: No actual indentation is intended - only shown like this for posting)
>
>     someCommand ... << EOF | someOtherCommand
>     some data
>     for someCommand
>     EOF
>
> This should work, right?
>
> In simple cases, it does (seem to) work OK.
>
> However, in the actual real world case, it is more like:
>
>     someCommand -x -y "sjdfhk" and more options \
> 	-g and still more options -Q "another option" << EOF |

I think you need "| \" at the end of this line.  At least that's what I
usually do and it seems to work.

> 	/usr/lib/ANotherCommand -x "with option" and "more options"
>     some data
>     for someCommand
>     EOF

-- 
Ben.