Unix commandline to repeat command with pipes

Posted by bguiz on Super User See other posts from Super User or by bguiz
Published on 2010-03-03T06:00:59Z Indexed on 2010/03/08 6:51 UTC
Read the original article Hit count: 562

Filed under:
|
|
|

I want to write a script that will repeat a commandline that usually contains pipes

./myscript.sh ls -lart |grep ^d

And in myscript.sh I do a bunch of stuff, and then want to execute ls -lart |grep ^d and pipe the output from that into something else.

(sorry in advance if this is really simple and has a 1-liner solution).

So far I have tried

$@ | someothercommand

and

$* | someothercommand

But to no avail...

© Super User or respective owner

Related posts about unix

Related posts about command-line