Re: Using << and an output pipe together in shell (bash)

Liste des Groupes 
Sujet : Re: Using << and an output pipe together in shell (bash)
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.unix.shell
Date : 31. Oct 2024, 23:37:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87r07v99wd.fsf@bsb.me.uk>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
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.

Date Sujet#  Auteur
31 Oct 24 * Using << and an output pipe together in shell (bash)10Kenny McCormack
31 Oct 24 +- Re: Using << and an output pipe together in shell (bash)1Janis Papanagnou
1 Nov 24 +* Re: Using << and an output pipe together in shell (bash)6Ben Bacarisse
1 Nov 24 i`* Re: Using << and an output pipe together in shell (bash)5Kenny McCormack
1 Nov 24 i +* Re: Using << and an output pipe together in shell (bash)3Janis Papanagnou
1 Nov 24 i i`* Re: Using << and an output pipe together in shell (bash)2Kenny McCormack
1 Nov 24 i i `- Re: Using << and an output pipe together in shell (bash)1Lem Novantotto
1 Nov 24 i `- Re: Using << and an output pipe together in shell (bash)1Kaz Kylheku
3 Nov 24 `* Re: Using << and an output pipe together in shell (bash)2Helmut Waitzmann
4 Nov 24  `- Re: Using << and an output pipe together in shell (bash)1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal