Computing.Net > Forums > Unix > Create an alias or command ?

Create an alias or command ?

Reply to Message Icon

Original Message
Name: aka
Date: August 22, 2005 at 15:30:40 Pacific
Subject: Create an alias or command ?
OS: WinXP/Linux
CPU/Ram: 256
Comment:

My idea is to create an alias or command who runs this:

grep -A32 -B9 (text) (file)

So it will bring me 32 lines AFTER the text I grep and 9 lines BEFORE
the grep search on the file xxxxxx

Now, the idea is to create an alias (or command) with the name
"gime" who execute the command above, so I only need to write:

%:gime (text)

Can I specify it as an alias or need it be a command, if so, how can i create it
on bash

Something like this ?

#!/usr/local/bin/bash

grep -A32 -B9 $1 myfile

And save it as "gime" ?

Thanks a lot for your help.


Don“t freak out until you know the facts...Relax...!


Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Create an alias or command ?

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge