|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 2008-04-25, Arnaud Dagnelies <arnaud.dagnelies@gmail.com> 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 someScript doesn't change, you might consider using awk or perl. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
thx, great, i'll try that
|
|
![]() |
| Outils de la discussion | |
|
|