02-26-2010
Thanks it worked
somasekhar gajjala
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I want to grep one file for a search string and get the next 10 lines after the search string.
for eg,in file tnsnames.ora,i have 100 entries.i want to search for one string and get the entry for that db.
please help how to acheive this using awk or sed?
Thanks. (11 Replies)
Discussion started by: raga
11 Replies
2. Shell Programming and Scripting
Hi i want to write a script that will search a filename e.g. test06abc.txt for a string and if it contains this string then set a variable equal to something:
something like:
var1=0
search <filename> for 06
if it contains 06 then
var1=1
else
var1=0
end if
but in unix script :) (4 Replies)
Discussion started by: tuathan
4 Replies
3. Shell Programming and Scripting
Hi,
i have to search for a char like that :
export var1="i am not happy /not happy"
with a command like :
grep $var1 file
but this not working with me !!!
thank you in advance. (2 Replies)
Discussion started by: tizilfin
2 Replies
4. UNIX for Dummies Questions & Answers
hi!
i'm trying to get grep to do an exact match for the following pattern but..it's not quite working. I'm not too sure where did I get it wrong. any input is appreciated.
echo "$VAR" | grep -q '^test:]name'
if ; then
printf "test name is not found \n"
fi
on... (4 Replies)
Discussion started by: jazzaddict
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
This is what I have done so far which is wrong for some reason:
grep -h "stringA | stringB" filename
Thank in advance! (5 Replies)
Discussion started by: jboy
5 Replies
6. Shell Programming and Scripting
Hey guys,
I'm having a bit of trouble getting this to work using either sed or grep. It's possible awk might be the ticket I need as well, but my regulat expression skills aren't quite up to the task for doing this.
I'm looking to grep for the string ERROR from the following log up until any... (6 Replies)
Discussion started by: terrell
6 Replies
7. Shell Programming and Scripting
I want to write the syntax so does not count line with no space.
So currerntly it is showing lines as 5, but i want to show 4.
# cat /tmp/mediacheck | sort -u | grep -vi " " | awk '{print $1}' | wc -l
BA7552
BAA002
BAA003
BAA004 (6 Replies)
Discussion started by: Junes
6 Replies
8. Shell Programming and Scripting
Hi All,
I'm using aix flavour unix where im trying for the below kind of pattern to search in all the files in a directory.
I tried with different possible combinations like
grep -ir "out.*\transaction_ctry_code" * etc....
Pattern I'm trying for :
out<any thing>country_cd
Here i... (0 Replies)
Discussion started by: rmkganesh
0 Replies
9. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
10. UNIX for Beginners Questions & Answers
I have a file xyz with the following content
PPPL 0123
PPPL 0006
POFT 0923
POFT 1111
WENT 2323
SEND 2345
I also have another file named MasterFile where it contains the above mentioned data million times with different digits at the end for example some times it contains SEND 9999 or WENT... (4 Replies)
Discussion started by: knijjar
4 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)