Sponsored Content
Full Discussion: Awk and print help
Top Forums Shell Programming and Scripting Awk and print help Post 302277134 by Rhije on Thursday 15th of January 2009 01:53:51 PM
Old 01-15-2009
Parsing exim logs eh? yeah.. I hate that.. but try this:

tail /var/log/exim_mainlog | awk -F"F=<.*?>" '$2 !~ /^$/ {print $2}'

The great thing about -F is that you can use regex.. so that works. I use the $2 !~ /^$/ to weed out blank lines (because they do happen). If you want to make it pretty, you can pipe that to: cut -d: -f2
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk print $2

/oracle/ID1/saparch"|awk '{print $2}' what does print $2 means? (1 Reply)
Discussion started by: yls177
1 Replies

2. Shell Programming and Scripting

How do I get awk to print a " in it's print part?

The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies

3. Shell Programming and Scripting

awk and print

Hi What is the correct syntax for use a variable value within a print sentence : Example: VAR1=$1 VAR2=$2 ls -l $VAR2/*.LOG | grep -v $VAR1 | nawk -F " " '{ print "mv "$9 " /backup/BACKUP/backup_db_type/$VAR1_arch/."}' > move_arch_des.sh Is this case i need to print $VAR1 within... (3 Replies)
Discussion started by: osymad
3 Replies

4. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

5. Shell Programming and Scripting

print through AWK

Hi friends I need one help from you . I want to print name='JACK' through . how can i make it . awk '{print "name=jack"}' it ll print name=JACK (6 Replies)
Discussion started by: imipsita.rath
6 Replies

6. Shell Programming and Scripting

Print using awk

Hi.. I have two files. contents of the files are as below. header1.dat ------------- This is a header record. header2.dat ------------- This is a header record. Date:2011-01-05 I am executing the below scripts. HEADER1=`cat header1.dat` HEADER2=`cat header2.dat` awk 'BEGIN... (2 Replies)
Discussion started by: 46019
2 Replies

7. UNIX for Advanced & Expert Users

awk print help

In this: $ awk '{ print "var is", var }' var=TEST file1 What does the print part do? { print "var is", var } (4 Replies)
Discussion started by: cokedude
4 Replies

8. Shell Programming and Scripting

AWK print AWK command

awk '{print "awk '{sub(/pdb_00/,"pdb_"$0"_00"); print}' pdb_"$0"_00.namd > tempo"; print "mv tempo pdb_"$0"_00.namd"}' datA2.dat > copy_script2.bash This works when trying to print 'sed etc. etc' but if I switch to using AWK to print a set of AWK commands it doesn't work... e.g. this... (3 Replies)
Discussion started by: chrisjorg
3 Replies

9. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

10. Shell Programming and Scripting

Awk: Print count for column in a file using awk

Hi, I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1). Input: 919143110065 919143110065 919143110052 918648846132 919143110012 918648873782 919143110152 919143110152 919143110152... (2 Replies)
Discussion started by: siramitsharma
2 Replies
relaytest(1)						      General Commands Manual						      relaytest(1)

NAME
relaytest - attempt to use SMTP to relay to a DSBL-compliant host SYNOPSIS
relaytest [-v] <ip address[:port]> DESCRIPTION
relaytest attempts to connect to the specified <ip address> on the specified port (default is port 25) and uses a variety of tests to attempt to relay through the host. In the tests below, source.com is sender_domain from dsbl.conf(5) and sender is sender_user. Non-domain-specific tests: MAIL FROM:<sender@source.com> RCPT TO:<listme@dsbl.org> MAIL FROM:<sender@source.com> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<sender@source.com> RCPT TO:listme@dsbl.org MAIL FROM:<sender@source.com> RCPT TO:<dsbl.org!listme> MAIL FROM:<nobody> RCPT TO:<listme@dsbl.org> MAIL FROM:<nobody> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<nobody> RCPT TO:listme@dsbl.org MAIL FROM:<nobody> RCPT TO:<dsbl.org!listme> MAIL FROM:<source.com!sender> RCPT TO:<listme@dsbl.org> MAIL FROM:<source.com!sender> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<source.com!sender> RCPT TO:listme@dsbl.org MAIL FROM:<source.com!sender> RCPT TO:<dsbl.org!listme> MAIL FROM:<> RCPT TO:<listme@dsbl.org> MAIL FROM:<> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<> RCPT TO:listme@dsbl.org MAIL FROM:<> RCPT TO:<dsbl.org!listme> relaytest then builds a list of possible domains, including "[127.0.0.1]", "localhost", [<ip address>], and any other domains that can be derived from reverse DNS of the IP or the SMTP greeting. Domain specific tests: MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme@dsbl.org"> MAIL FROM:<nobody@DOMAIN> RCPT TO:listme@dsbl.org MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme%dsbl.org@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme%dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme%dsbl.org"> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<"listme@dsbl.org"@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<@DOMAIN:listme@dsbl.org> MAIL FROM:<nobody@DOMAIN> RCPT TO:<dsbl.org!listme> MAIL FROM:<nobody@DOMAIN> RCPT TO:<dsbl.org!listme@DOMAIN> MAIL FROM:<DOMAIN!nobody> RCPT TO:<dsbl.org!listme> MAIL FROM:<DOMAIN!nobody> RCPT TO:<dsbl.org!listme@DOMAIN> MAIL FROM:<nobody@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<postmaster@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<administrator@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<sales@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<info@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<webmaster@DOMAIN> RCPT TO:<listme@dsbl.org> MAIL FROM:<listserv@DOMAIN> RCPT TO:<listme@dsbl.org> relaytest then tries a variety of SMTP AUTH methods to try to relay a message through the target server. The envelopes used for these tests are always: MAIL FROM:<sender@source.com> RCPT TO:<listme@dsbl.org> The SMTP AUTH methods tried are as follows: AUTH LOGIN, user=/webmaster, password=(null) AUTH LOGIN, user=admin, password=admin AUTH LOGIN, user=administrator, password=(null) AUTH LOGIN, user=test, password=test AUTH NTLM (anonymous) OPTIONS
-v Verbose mode. Details of the SMTP transaction are written to standard output. AUTHOR
Ian Gulliver <ian@penguinhosting.net> SEE ALSO
dsbl.conf(5), spamtrap(1) 2002-04-03 relaytest(1)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy