10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I need to egrep patterns in a file and limit number of matches to print for each matched pattern.
-m10 option is not working out in my sun solaris 5.10
Please guide me the options to achieve.
if i do head -10 , i wont be getting all pattern match results as output since for a... (10 Replies)
Discussion started by: ananan
10 Replies
2. Shell Programming and Scripting
input:
!@#$%2QW5QWERTAB$%^&*
The string above is not separated (or FS="").
For clarity sake one could re-write the string by including a "|" as FS as follow:
!|@|#|$|%|2QW|5QWERT|A|B|$|%|^|&|*
Here, I am only interested in patterns (their numbers are variable between records) containing... (16 Replies)
Discussion started by: beca123456
16 Replies
3. Shell Programming and Scripting
I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the:
-file name
-line number
-number of matches to the pattern /comp/ for each line.
Two example files:
cat... (4 Replies)
Discussion started by: pathunkathunk
4 Replies
4. Shell Programming and Scripting
Hello Everyone ,
I have two files. I want to pick line from file-1 and match with the complete data in file-2 , if there is a match print all the match lines in file 3. Below is the file
cat test1.txt
vikas
vikasjain
j ain
testt
douknow
hello@vik@
# 33
||@@ vcpzxcmvhvdsh... (1 Reply)
Discussion started by: mailvkjain
1 Replies
5. Shell Programming and Scripting
I have logs files which are generated each day depending on how many processes are running. Some days it could spin up 30 processes. Other days it could spin up 50. The log files all have the same pattern with the number being the different factor. e.g.
LOG_FILE_1.log
LOG_FILE_2.log etc etc
... (2 Replies)
Discussion started by: atelford
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a large, multiline log file.
I have used pcregrep to extract all entries in that log that match a particular pattern - where that pattern spans multiple lines.
However, because the log file is large, and these entries occur every few minutes, I still output a very large amount... (6 Replies)
Discussion started by: dbrb2
6 Replies
7. Shell Programming and Scripting
Hi,
i've a code
if (($A && ((!($A =~ /^\d+$/)))))
{
-- -- not a number
}
else
{
--- its number.
}
which matches for integer value, i need to modify that pattern where it matches decimal number with 2 decimal points and also integer value.
for eg: values 10, 10.00. 0.1, 1 , 3 must... (2 Replies)
Discussion started by: asak
2 Replies
8. Shell Programming and Scripting
I’m trying to modify someone perl script to fix a bug. The piece of code checks that the zone name you want to add is unique. However, when the code runs, it finds a partial match using grep, and decides it already exists, so the “create” command exits.
$cstatus = `${ZADM} list -vic | grep... (3 Replies)
Discussion started by: TKD
3 Replies
9. Shell Programming and Scripting
Hi All,
as the title says I need to extract N lines after match number X of a pattern.
e.g.
111
xxx
xxx
111
yyy
yyy
111
www
www
111
zzz
zzz
I would like to extract the two lines after the second 111 occurrence.
I tried with grep but I didn't find any options to do that.
Any... (11 Replies)
Discussion started by: f_o_555
11 Replies
10. UNIX for Dummies Questions & Answers
hi,
i'm having problem like this.
i wish to grep some keyword from certain files in one directory.
let's say i have a lot of files in my directory with the name of file.1 file.2 file.3 ...... file.500
i only wish to grep the keyword from file.20, file.21, file.23 .... file.50
i tried... (5 Replies)
Discussion started by: rei
5 Replies