Unix Shareware with the -B and -A grep fuctionality


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix Shareware with the -B and -A grep fuctionality
# 1  
Old 10-05-2005
Unix Shareware with the -B and -A grep fuctionality

Hi,

Can anyone help me or tell me how I can get a unix shareware that will allow me use grep with the following flags -A and -B. the version of Unix we have dont have this.

I am doing a grep on a log to capture any error but I want what is returend to be more meaningful.

Thanks

Amen.
# 2  
Old 10-05-2005
GNU grep has those flags. Use the link and get the required version.

vino
# 3  
Old 10-05-2005
Thank you so much. I havve been able to download the files. and I have used gunzip to unzip the files. I am new to this. I am trying to install this in my unix or AIX environment by running e.g by typing grep-2.5.1.tar at the command prompt and i get a permission denied error. I have used the chmod to give read write and execute access to the file.

What do I do next. I am really new at this.

Thanks.
# 4  
Old 10-05-2005
Its a tar'ed file. You need to untar it.

tar xvf grep-2.5.1.tar

That will extract grep into the directory where you are running the command from. Since grep is a command run quite frequently, you might have to untar it into a directory which is there in the PATH. Or replace the existing non-GNU grep with the new one.

That decision is yours.
# 5  
Old 10-05-2005
I did all that and I am still not able to use the flag.

this is the message I get when I do a man grep -A

[/home/user:]grep -A
grep: Not a recognized flag: A
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] pattern_list [file...]

What do I do? Please help

Thanks.
# 6  
Old 10-05-2005
Post the results of
Code:
`which grep`

Looks like your grep is still the non-GNU grep.
# 7  
Old 10-05-2005
here is what i get

/home$`which grep`
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] pattern_list [file...]


Thanks.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help using Grep with Unix

Hey there, I'm brand new to using Unix as I just started a course on it in my University, and I currently working through a worksheet which focuses on the many commands and methods of GREP (I'm working through the terminal command line in Unix). Currently I am confused with using Grep and vi in the... (1 Reply)
Discussion started by: SilvarHawke
1 Replies

2. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

3. UNIX for Dummies Questions & Answers

| help | unix | grep - Can I use grep to return a string with exactly n matches?

Hello, I looking to use grep to return a string with exactly n matches. I'm building off this: ls -aLl /bin | grep '^.\{9\}x' | tr -s ' ' -rwxr-xr-x 1 root root 632816 Nov 25 2008 vi -rwxr-xr-x 1 root root 632816 Nov 25 2008 view -rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies

4. Shell Programming and Scripting

unix grep

Hola, solicito ayuda para procesar un archivo de texto como el siguiente y luego obtener las variables. archivo.txt: Sending 5, 100-byte ICMP Echos to 10.249.98.94, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 28/33/44 ms Variables a obtener: ... (5 Replies)
Discussion started by: mmunarriz
5 Replies

5. UNIX for Dummies Questions & Answers

Using Grep within a UNIX Script

Hi, I'm trying to save the wc from a grep command in my unix script and then later in my script I try to reference the variable but I have no luck. Any help is greatly appreciated! -------------------- set xTest = 'grep -i lisa daily.log' if ; then echo "TEST" >> daily.log fi... (6 Replies)
Discussion started by: lisa_0801
6 Replies

6. Shell Programming and Scripting

unix grep command

I need to seach all strings that matches "if ; then" in all files If i put grep "if ; then" *.* it is not giving any result (1 Reply)
Discussion started by: pmsuper
1 Replies

7. UNIX for Dummies Questions & Answers

Free Shareware for UNix.

Hello Guys, Just started with unix. I need it to keep my job. I need a free downloadable Unix simulator to use. I already have a unix material i'm reading. Any ideas. :) (1 Reply)
Discussion started by: iwegbue3
1 Replies

8. UNIX for Dummies Questions & Answers

File Compare Shareware??

I have been recruited to build a NOC for a startup company. My job consists of intervewing vendors and their products for monitoring the network and our systems. Problem being is that we will not be making a decision right away on what we will be bringing aboard and I need to be frugal (did I say... (2 Replies)
Discussion started by: tonyo61
2 Replies
Login or Register to Ask a Question