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


.



Relevant Pages

  • Re: passing arguments within pipes
    ... Seb wrote: ... and eliminate the middle-man: ... Oh my, those two were meant to be the same (sorry, I'm juggling between ... on the right side of a pipe. ...
    (comp.unix.shell)
  • Re: fileevent and vwait dilema with one tcl script calling multiple copies of another
    ... pies of each script. ... loop *IS* the event loop and the 'main program' has no loop at all. ... # Event proc: file read event. ... proc Reader {pipe} { ...
    (comp.lang.tcl)
  • accessing a pipe from TCL and C, hang in `close/exit
    ... I have a TCL shell script which opens a socket to some remote host, ... and opens a read-converter pipe. ... data arrives on the remote host. ... Now I want to close the channel from C++: ...
    (comp.lang.tcl)
  • I can process my mail!
    ... I figured out how to pipe mail to my own scripts! ... the script as an argument. ... that won't confuse boundaries for message text. ... sendmail, but I'm not that interested in sendmail in particular. ...
    (comp.unix.questions)
  • Re: how do i..
    ... On Sun, 2004-08-22 at 18:31, Mr. Oberoi wrote: ... > error results from the program(shell script) to a file. ... scriptname> filename 2>&1 ... the pipe character is used to "chain" the output of the command on ...
    (Fedora)