I have a script which searches a huge log file for the existence of a specified string and if the string is not present i receive an alert mail.
Here's an extract:
STRING=$(grep 'warning' logfile | tail -1 | wc -l)
if (( ${STRING} > 0 ));
then
print -- "---- Warning etc.... (3 Replies)
Hi,
Can any one pelase tell me how to grep multiple strings from multiple files in a singel folder?
grep -E "string1|string2|string3|string4|string..."
its taking lots of time..
can any please tell me fast grep???
URGENT (10 Replies)
How to grep multiple string occurance in input file using single grep command? I have below input file with many IDP, RRBE messages. Out put should have count of each messages.
I have used below command but it is not working
grep -cH "(sent IDP Request)(Recv RRBCSM)" *.txt ... (5 Replies)
Hi,
New to shell scripting....
I have log file content as below:
I have to count the number of occurences of ERROR or INFO Messages.
So, I cut 5 th column and uniquly sorted and redirected it to new.txt file.
But I want copy to S*/Filename and T*/Filename of respective ERROR or INFO... (5 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hi,
I will use below command for grep single string ("osuser" is search string)
ex: find . -type f | xarg grep -il osuser
but i have one more string "v$session"
here i want to grep in which file these two strings are present.
any help is appreciated,
Thanks in advance.
Gagan (2 Replies)
Hi, every one!
I have a file with multiple strings.
file1
ATQRGNE
ASQGVKFTE
ASSQYRDRGGLET
SPEQGARSDE
ASSRDFTDT
ASSYSGGYE
ASSYTRLWNTGE
ASQGHNTD
PSLGGGNQPQH
SLDRDSYNEQF
I want to grep each string in hundreds of files in the same directory, further, I want to find out the string... (7 Replies)
Hi,
Whether we can search multiple strings using or in grep -F
In Generally,
grep -F "string1" "filename.txt"
How to search for multiple string using grep -F as we using grep
grep "string1\|string2" "filename.txt"
Regards,
Nanthagopal A (10 Replies)
Consider i have the below data in my log file.
i want to grep using "Monday" and "Working"
So the only output i expect is
Can you help me with the grep query for Sun Sparc ?
Usage: grep -hblcnsviw pattern file . . . (8 Replies)
I need to get text between two strings <app-deployment file=" and </app-deployment> as it appears more than once in the file then how can i store the text between each occurrence in a separate file ?
Thus, i need the below to go in found1.tmp
and the below to go in found2.tmp
... (8 Replies)
Discussion started by: mohtashims
8 Replies
LEARN ABOUT ULTRIX
tr
tr(1) General Commands Manual tr(1)Name
tr - translate characters
Syntax
tr [-cds] [string1[string2]]
Description
The command copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found
in string1 are mapped into the corresponding characters of string2. When string2 is short it is padded to the length of string1 by dupli-
cating its last character. Any combination of the options -cds may be used: -c complements the set of characters in string1 with respect
to the universe of characters whose ASCII codes are 0 through 0377 octal; -d deletes all input characters in string1; -s squeezes all
strings of repeated output characters that are in string2 to single characters.
In either string the notation a-b means a range of characters from a to b in increasing ASCII order. The backslash character () followed
by 1, 2 or 3 octal digits stands for the character whose ASCII code is given by those digits. A followed by any other character stands
for that character.
The following example creates a list of all the words in `file1' one per line in `file2', where a word is taken to be a maximal string of
alphabetics. The second string is quoted to protect from the Shell. 012 is the ASCII code for newline.
tr -cs A-Za-z '