Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (feature request) Shell script within shell script
- X-seq: zsh-users 5892
- From: William Park <opengeometry@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: (feature request) Shell script within shell script
- Date: Fri, 7 Feb 2003 15:23:24 -0500
- In-reply-to: <1030204091832.ZM15610@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030128042243.GA3888@xxxxxxxxxxxxxxxxxxxxxx> <20030128104034.GA6470@xxxxxxxxxxxxxxxxxxxxxx> <20030131204945.GA1189@xxxxxxxxxxxxxxxxxxxxxx> <20030201073655.GA3893@xxxxxxxxxxxxxxxxxxxxxx> <20030203231518.GA8900@xxxxxxxxxxxxxxxxxxxxxx> <1030204091832.ZM15610@xxxxxxxxxxxxxxxxxxxxxxx>
On Tue, Feb 04, 2003 at 09:18:32AM +0000, Bart Schaefer wrote:
> On Feb 3, 6:15pm, William Park wrote:
> }
> } I've finally managed to find a solution. It's called "process
> } substitution":
> } function test1 () {
> } awk -f <( cat <<"EOF"
> } ...
> } ...
> } EOF
> } )
> } }
>
> Just watch out for what happens if you ever have unbalanced
> parentheses in the content of the here-document.
A classic solution:
function test1 () {
exec 10<<"EOF"
...
...
EOF
awk -f /dev/fd/10
exec 10<&-
}
I didn't have to patch anything. I just have to keep track of fd's
instead of external files. If the here-documents don't change, then I
can put 'exec' outside the function.
--
William Park, Open Geometry Consulting, <opengeometry@xxxxxxxx>
Linux solution for data management and processing.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author