Re: how to make a script of this one-liner...
- From: Glenn Jackman <glennj@xxxxxx>
- Date: 25 Apr 2008 16:10:00 GMT
At 2008-04-25 11:30AM, "Arnaud Dagnelies" wrote:
Hello,
I would like to write a small script used as follows:
igrep ***
That basically simply performs the grep and formats the output in a
special way using another script. In short, what should be executed
is:
grep *** | someScript
...where the *** is anything that can be given to grep. Thus not only
the pattern and files but also including flags and params and so on.
What would be the easiest way to do that?
If you use a POSIX shell, use a function:
igrep() {
grep "$@" | somescript
}
--
Glenn Jackman
"If there is anything the nonconformist hates worse than a conformist,
it's another nonconformist who doesn't conform to the prevailing
standard of nonconformity." -- Bill Vaughan
.
- References:
- how to make a script of this one-liner...
- From: Arnaud Dagnelies
- how to make a script of this one-liner...
- Prev by Date: how to make a script of this one-liner...
- Next by Date: Re: how to make a script of this one-liner...
- Previous by thread: how to make a script of this one-liner...
- Next by thread: Re: how to make a script of this one-liner...
- Index(es):
Relevant Pages
|