10-15-2008
Is this what you are trying to accomplish?
> echo "start protocol:","Received message:","Received SIGNON req","SIGNON_REPLY->SIGNON" | tr -d " " | tr "," " "
startprotocol: Receivedmessage: ReceivedSIGNONreq SIGNON_REPLY->SIGNON
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I want to parse this file....
( 0 , 0 ) =>heading1
( 0 , 1 ) =>value1.1a
( 0 , 2 ) =>value2.1a
( 1 , 0 ) =>heading2
( 1 , 1 ) =>value1.1b
( 1 , 2 ) =>value2.1b
( 2 , 0 ) =>heading3
( 2 , 1 ) =>value1.1c
( 2 , 2 ) =>value2.1c
( 3 , 0 ) =>heading4
( 3 , 1 ) =>value1.1d
( 3 , 2... (15 Replies)
Discussion started by: tungaw2004
15 Replies
2. Shell Programming and Scripting
Hi Guys,
I was wondering if you could help me out -
I have a directory /home/users/datafiles/ which contain files "dat dd-mm-yy.xls"
I am trying to write a script which does the following -
(1) loops through all the files
(2) retrieves the dd-mm-yy string and converts it into a... (12 Replies)
Discussion started by: muser
12 Replies
3. Shell Programming and Scripting
I have a big xml file with little formatting in it. It contains over 600 messages that I need to break each message out in its own separate file.
The xml file looks in the middle of it something like this:
</Title></Msg><Msg><Opener> Hello how
are you?<Title> Some says hello</Title><Body>... (3 Replies)
Discussion started by: quixoticking11
3 Replies
4. Shell Programming and Scripting
#! /usr/local/bin/perl -w
$ip = "$ARGV";
$rw = "$ARGV";
$snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw";
$snmpw = "/usr/local/bin/snmpwalk -Os -c $rw";
$syst=`$snmpg $ip system sysName sysObjectID`;
sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies
5. Shell Programming and Scripting
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies
6. Shell Programming and Scripting
I have always struggled when parsing a file vertically vs. by line horizontally. Can't seem to get my head around the concept. Here again I need to convert vertical output to horizontal output.
original output
root@acuransx:bpplsched 2000-STAND3 -v -M acuransx -l
<2>bpplsched: INITIATING:... (4 Replies)
Discussion started by: jouuu
4 Replies
7. Shell Programming and Scripting
I trying to get only the highest version of the file names from an file which has list of file names.
EX:
CATEGORYDISPLAY JSP.A-SRC_BLD;2.4
CATEGORYDISPLAY JSP.A-SRC_BLD;2.5
CATEGORYDISPLAY JSP.A-SRC_BLD;2.1
CATEGORYDISPLAY JSP.A-SRC_BLD;2.2
The Script should display only the highest... (7 Replies)
Discussion started by: rocker_me2002
7 Replies
8. Shell Programming and Scripting
Hi All,
I have an input file something like this:
Line1
Line2
....
LineN
Identifier
( Field1a, Field1b;
Field2a, Field1b;
Field3a, Field1b;
.....
)
LineN+1
LineN+2
etc..
I basically need Field1a, Field2a, Field3a.... from the above file (6 Replies)
Discussion started by: tostay2003
6 Replies
9. Shell Programming and Scripting
All,
Can somebody provide me with some sed expertise on how to parse the
following line.
27-MAR-2011 10:28:01 * (CONNECT_DATA=(SID=dmart)(CID=(PROGRAM=sqlplus)(HOST=mtasnprod1)(USER=mtasnord))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.197.7.47)(PORT=54881)) * establish * dmart * 0
I would like... (3 Replies)
Discussion started by: BeefStu
3 Replies
10. Shell Programming and Scripting
Can some body show me a sed command to remove everyhing upto a '/' and
leave the rest of the line.
cat data.out
This is the directory /tmp/xxx/yy.ksh
I only want to get the fullpath name
/tmp/xxx.yy.ksh
Thanks in advance to all who answer. (3 Replies)
Discussion started by: BeefStu
3 Replies
LEARN ABOUT DEBIAN
email::received
Email::Received(3pm) User Contributed Perl Documentation Email::Received(3pm)
NAME
Email::Received - Parse an email Received: header
SYNOPSIS
use Email::Received;
for ($mail->header("Received")) {
my $data = parse_received($_);
return "SPAM" if rbl_lookup($data->{ip});
}
DESCRIPTION
This module is a Perl Email Project rewrite of SpamAssassin's email header parser. We did this so that the great work they did in analysing
pretty much every possible Received header format could be used in applications other than SpamAssassin itself.
The module provides one function, "parse_received", which takes a single Received line. It then produces either nothing, if the line is
unparsable, a hash reference like this:
{ reason => "gateway noise" }
if the line should be ignored for some good reason, and one like this:
{ ip => '64.12.136.4', id => '875522', by => 'xxx.com',
helo => 'imo-m01.mx.aol.com' }
if it parsed the message. Possible keys are:
ip rdns helo ident envfrom auth by id
RULE FORMAT
Where SpamAssassin used a big static subroutine full of regular expressions to parse the data, we build up a big subroutine full of regular
expressions dynamically from a set of rules. The rules are stored at the bottom of this module. The basic format for a rule looks like
this:
((var=~)?/REGEXP/)? [ACTION; ]+
The "ACTION" is either "SET variable = $value", "IGNORE "reason"?", "UNPARSABLE" or "DONE".
One control structure is provided, which is basically an "if" statement:
GIVEN (NOT)? /REGEXP/ {
ACTION+
}
EXPORT
parse_received
SEE ALSO
Mail::SpamAssassin::Message::Metadata::Received, from which the rules and some of the IP address matching constants were blatantly stolen.
Thanks, guys, for doing such a comprehensive job!
AUTHOR
simon, <simon@>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by simon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.
perl v5.10.0 2006-03-24 Email::Received(3pm)