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...