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

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

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








Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home



Results for: Create an alias or command ?

Is it possible ?
    Summary: 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 id...
www.computing.net/answers/unix/is-it-possible-/7114.html

clear command to c command
    Summary: It is common (but not required) to have a "login profile script" that runs automatically when you log in, for the purpose of setting up your session environment such as desired variables and aliases, ...
www.computing.net/answers/unix/clear-command-to-c-command/7001.html

c-shelll command
    Summary: HI, I have a couple question about C-Shell command. 1.) How to create a variable named d140 (non-environment) whose value is the path to your FILE1 subdirectory in your home in C-Shell. 2.) Create an...
www.computing.net/answers/unix/cshelll-command/4322.html








Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes Today.
Discuss in The Lounge
Poll History






Data Recovery Software