Re: passing arguments within pipes



On 10 Apr., 01:53, Seb <splu...@xxxxxxxxx> wrote:
On Mon, 9 Apr 2007 23:42:32 +0000 (UTC),

pac...@xxxxxxxxxxxx (Alan Curry) wrote:
In article <87d52dceik....@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Seb <splu...@xxxxxxxxx> wrote:
some_file=$(ls | gawk 'FNR == 1')
fun ${curfile} 1 6
some_file and curfile are the same thing I guess. You can combine those
and eliminate the middle-man:

Oh my, those two were meant to be the same (sorry, I'm juggling between
the actual script and comp.unix.shell too fast). I get it, there's no way
to parse the output from a pipe into a particular argument of a function
on the right side of a pipe.

You can do that, too, if you don't line command substitution. See my
xargs example upthread. On my system (using -I to define the
placeholder)...

ls | xgawk 'NR == 3' | xargs -I{} fun {} 1 6


Janis

Thank you both for putting me on track.

Cheers,

--
Seb


.