Sponsored Content
Top Forums Shell Programming and Scripting Grep out ONLY subject from maillog Post 302874381 by Jotne on Friday 15th of November 2013 01:50:05 AM
Old 11-15-2013
Another awk
Code:
awk '/T=/ {f=NR} f&&NR-1==f' RS=\" file
Subject Subject  Subject

or this:
Code:
awk '/T=/ {getline;print}' RS=\" file
Subject Subject  Subject

@Chubler_XL
This awk -F\" '/T=/{print $2}' infile is not very robust.
It just print second field (using " as FS) if the line contain T=. So if other filed has quotes this will fail.

Last edited by Jotne; 11-15-2013 at 02:57 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

maillog - Error Message

dear expert Im using shell script to send mail from unix server. My script like below: #! /bin/sh -f # Set necessary variables #export PATH #PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/contrib/bin PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/contrib/bin:$PATH; export PATH... (0 Replies)
Discussion started by: unknown2205
0 Replies

2. UNIX for Advanced & Expert Users

maillog extract

Hi all, below are some text extracted from maillog. I have a cronjob running at 1720 daily and it will send mails to me. it was working fine on the 27 Sept.Sep 27 17:20:01 venus sendmail: k8R9K0OR032710: from=user1, size=580, class=0, nrcpts=1, msgid=<200609270920.k8R9K0OR032710@venus.domain.com>,... (1 Reply)
Discussion started by: new2ss
1 Replies

3. UNIX for Advanced & Expert Users

maillog errrors

Watching my maillog this morning i have discovered some errors but I cant track down whats causing them. Jun 16 11:04:12 ws096 sendmail: m5GExW7e006613: Milter (spamass-milter): timeout before data read Jun 16 11:04:12 ws096 sendmail: m5GExW7e006613: Milter (spamass-milter): to error state Jun... (3 Replies)
Discussion started by: mcraul
3 Replies

4. Gentoo

inserting grep -c value into an email subject

I am profoundly new to *nix, but had a project dropped in my lap that has sparked an interest, leading me here. I was tasked with daily sending one of our customers a listing of all the spam our filter blocked that was heading for them. Between Google and I; I discovered the Server is running... (3 Replies)
Discussion started by: GrendelPrime
3 Replies

5. UNIX for Advanced & Expert Users

/var/log/maillog isn't updating. Postfix related

can someone please help me figure how i can get maillog to start updating again? it just all of a sudden stopped. and postfix isn't writing to it anymore. I'm running a Ubuntu box 8.04 thanks (2 Replies)
Discussion started by: SkySmart
2 Replies

6. Solaris

Flood Messages in maillog

Hi All, I am getting large number of messages in below file /www/wls8/logs/HOSTS/tswebd01-zd01/maillog/maillog In past 24 hours, it has been increased by near to 1 GB. Can somebody help in finding, from where these messages are being generated and how to I stop them ? Same kind of messages... (11 Replies)
Discussion started by: solaris_1977
11 Replies

7. Shell Programming and Scripting

Grep the last line and put on mail subject

I have mail: cat /home/oracle/scripts/dbsizedaily.txt | mail -s "$TODAY: PROD DB Size" $RECIPIENTS I like to get and put USED_GB and %USED of the very last row from /home/oracle/scripts/dbsizedaily.txt. /home/oracle/scripts/dbsizedaily.txt has : DATE TIME TOTAL_GB USED_GB ... (6 Replies)
Discussion started by: Daniel Gate
6 Replies

8. UNIX for Dummies Questions & Answers

How to grep a string and add to subject line of a mail?

I am running a mailx command as follows in Linux: mailx -s "Elapsed Time: " ora_dbas < $RUNDIR/sql_timings.out I am trying to parse the file "sla_local_sql_timings.out" for the word Elapsed Time: and get the time from that file stored in a variable and display that variable in the subject... (4 Replies)
Discussion started by: vrkcamry
4 Replies

9. Shell Programming and Scripting

Filter maillog

Hi, I need to take them all fields SendTo and ip address from a file maillog First I look at all emails from containing the empty field. # zcat /var/log/mail/maillog-20140331.server1.gz | grep "from=<>" | awk '{print $6}' > 1.txt output: Mar 30 23:31:24 servidor1 postfix/smtpd:... (2 Replies)
Discussion started by: Jomeaide
2 Replies

10. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
DXmSvnAddEntries(3X)													      DXmSvnAddEntries(3X)

NAME
DXmSvnAddEntries - Opens new entries in the structure. SYNOPSIS
void DXmSvnAddEntries( Widget widget, int after, int count, int level, XtPointer* tags(), Boolean index ); PARAMETERS
The identifier (widget ID) of the SVN widget. An integer that represents the entry number that the newly opened positions are inserted after. (If you want to add an entry before number 1, set this parameter to 0.) An integer that represents the number of entries to add to the array. An integer that represents the level number of the entries being added. A level number of 0 indicates top-level entries. A pointer to an array of longwords that contain the tag values for each entry being added. If the tag values are not being used, a Null pointer may be passed. This value can also be changed with either the DXmSvnSetEntry or DXmSvnSetEntryTag routine call. A Boolean value that, when True, indicates that all of the entries being added should appear in the scroll index window when the user drags the slider. This value can be changed with either the DXmSvnSetEntry or DXmSvnSetEntryIndexWindow routine. Note that the index window is used only when the DXmNliveScrolling resource is set to False. DESCRIPTION
The DXmSvnAddEntries routine enables an application to process the expansion of an entry. The value supplied for count determines how many entries the application should open. The actual text of the entry is not passed. The first time an entry is displayed to the user, the SVN widget issues the DXmSvnNgetEntryCallback to obtain information about the entry. If the user never positions the window in an area where a particular entry is visible, the callback will never be made. Make this call in your application between calls to DXmSvnDisableDisplay and DXmSvnEnableDisplay. DXmSvnAddEntries(3X)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy