10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
# mailq | awk '{match($0, /quota/)} {print $0}' | head
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
9A6A7DE117E 84309 Sat Sep 30 14:14:50 alerts-noreply+xxxxx=xxx.sg@xxx.xx.xxx
(host alt1.gmail-smtp-in.l.google.com said: 452-4.2.2 The email account that you... (2 Replies)
Discussion started by: ashokvpp
2 Replies
2. Shell Programming and Scripting
My script have to read logfile, and take some action, if in pattern are strings:
1) exit 0 strings pattern
... "INF - Status"... success
2) exit 1 (! as not) strings pattern
... "INF - Status"... !success
Simple example, what works
#!/bin/bash
tail -f regex.log | while read LOGLINE
... (7 Replies)
Discussion started by: kvaikla
7 Replies
3. UNIX for Advanced & Expert Users
Hi All,
We have this regex:\\*.*?(.600).*?.(LISTEN|ESTABLISHED)
OS = Solaris 10
The purpose of this regex is to match the ports in output of "netstat -an" and report if any ports between 6000-6009 are getting used. The only problem is if I have something like this (sample output as... (6 Replies)
Discussion started by: sk2code
6 Replies
4. Shell Programming and Scripting
Hi
We have a tool to monitor logs in our environment. The tool accepts log pattern match only using regex and I accept I am a n00b in that:confused:. I had been banging my head to make it work without much success and at last had to turn on to my last option to post it here. I had got great... (2 Replies)
Discussion started by: radioactive9
2 Replies
5. Shell Programming and Scripting
Hello to all,
How would be the correct regex to match only the first occurence of
the pattern 3.*6.
I'm trying with 3.*6 trying to match only 34rrte56, but with my current regex is matching 4rrte567890123456789123powiluur56. And if I try with ?
doesn't print anything
echo... (6 Replies)
Discussion started by: Ophiuchus
6 Replies
6. Shell Programming and Scripting
Hi
Input:
MYTEXT.aa.bb
cc.MYTEXT.aa.bb
ee.dd.cc.MYTEXT.aa.bb
cc.NOTEXT.a.b
Output:
<empty>
cc
cc
<empty>
I would like to use a regex to extract the last word before MYTEXT without the dot (2 Replies)
Discussion started by: chitech
2 Replies
7. Shell Programming and Scripting
I have read many tutorials and cannot get this to work. I need to use pcre (because that is what the library in the software we are using uses) and pcregrep everything except /home from the /etc/fstab
pcregrep '(?!/home)' /etc/fstab
It returns the entire fstab (This is on a RHEL5... (1 Reply)
Discussion started by: insania
1 Replies
8. Shell Programming and Scripting
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies
9. UNIX for Advanced & Expert Users
What do you think of this regex to match IP address? I have been reading up on regex and have seen some really long ones for IP. Would this fail in any scenarios?
(+\.){3}* (5 Replies)
Discussion started by: glev2005
5 Replies
10. Shell Programming and Scripting
Hi
Can somebody please help me know how do i match the basename using a regular expression using posix standard in shell script
suppose i want to match
/u01/Sybase/data/master.dbf the result should be master.dbf as i want to match everything after the last /
regards (8 Replies)
Discussion started by: xiamin
8 Replies