extract message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting extract message
# 1  
Old 01-15-2009
extract message

thx
thx

Last edited by ust; 01-16-2009 at 06:49 AM..
# 2  
Old 01-16-2009
Code:
awk '/hello world/ { print "hello world"; next }
{ print "Do nothing" }' FILENAME

More generally:

Code:
message=whatever
awk  '/'"$message"'/ { print "'"$message"'"; next }
{ print "Do nothing" }' FILENAME

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract repeating and check for for certain error message

Hi guys I have an log from an regular application processing where the processing is done every 10 minutes and is written to the same log which is rotated on daily basis. the block of log starts always with "Starting" and ends with a certain pattern "Completed" The catch is I want to... (7 Replies)
Discussion started by: kl1ngac1k
7 Replies

2. SuSE

Du -sh in / message

I have cloned a zLinux server and whenever I issue the command 'du -sh' on the / it always gives the below message: du: cannot access `./proc/3721/task/3721/fd/4': No such file or directory du: cannot access `./proc/3721/task/3721/fdinfo/4': No such file or directory du: cannot access... (5 Replies)
Discussion started by: schizoprenics
5 Replies

3. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

4. Shell Programming and Scripting

sed to extract a multiline subject from a mail message

I'm trying to extract a subject from a mail message but my subject example has 2 lines. How can I manage to extract it and write a string at the end of it? Consider this example: From: test@domain.com Subject: Re: U =?ISO-8859-1?Q?qu=EA=3F!=3F!=3F!!_wtff_=E7=E3o_=ED=F3?= ... (6 Replies)
Discussion started by: twisterbr
6 Replies

5. Shell Programming and Scripting

Search for a pattern,extract value(s) from next line, extract lines having those extracted value(s)

I have hundreds of files to process. In each file I need to look for a pattern then extract value(s) from next line and then search for value(s) selected from point (2) in the same file at a specific position. HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V TITLE CYTOCHROME... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies

6. Programming

[XQuery] How to Convert from JSON Message to XML Message with XQuery

Hi guys, I'm in a job of converting a restful webservice to soap. Tool for convertation uses XQuery. Now i need to convert a message like this: { "firstName": "John", "midName": null, "lastName": "Smith", "married": false, "address": { "streetAddress": "21 2nd... (5 Replies)
Discussion started by: tien86
5 Replies

7. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

8. UNIX for Dummies Questions & Answers

Unable to extract a tag from a very long XML message

Hi I have a log file which contain XML message. I want to extract the value between the tag : <businessEventId>13201330</businessEventId> i.e., 13201330. I tried the following commands but as the message is very long, unable to do it. Attached is the log file. Please provide inputs. --... (3 Replies)
Discussion started by: Sapna_Sai
3 Replies

9. Shell Programming and Scripting

Need to extract XML message from log

I need help to extract a following SOAP-ENV:Header XML message from the log. XML message need to be extracted: *************************** <SOAP-ENV:Header> <ServiceGatewayHeader> <SourceApplicationId>OXL</SourceApplicationId> <Version>1.0</Version> <UserId>TEST</UserId>... (4 Replies)
Discussion started by: tjshankar
4 Replies

10. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies
Login or Register to Ask a Question