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)
  • 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)
  • Re: IO::Pipe and loss of data
    ... May be I cut too much, but as the last run of my big script was ... > show at least how I work to send a message and use the pipe. ... There is a fixed amount of buffer (probably 4K ... for each "server". ...
    (comp.lang.perl.misc)