Sponsored Content
Top Forums Shell Programming and Scripting print multiple lines using the grep command. Post 302347663 by methyl on Wednesday 26th of August 2009 07:58:36 AM
Old 08-26-2009
What Operating System are you using?
How are you sending the mail?
How are you reading the mail?

If you are reading the mail with Microsoft Office Outlook, look at the following setting in that program:
Tools / Options / Email Options / "Remove extra line breaks in plain text messages".
If that option is set, uncheck the box.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines after grep

Hi all, I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following 1. Print the line number having word "START" 2. Print the next 11 lines. ... (4 Replies)
Discussion started by: jakSun8
4 Replies

2. Shell Programming and Scripting

AIX equivalent to GNU grep's -B and -A [print lines after or before matching lines]

Hi folks I am not allowed to install GNU grep on AIX. Here my code excerpt: grep_fatal () { /usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP" } Howto the same on AIX based machine? from manual GNU grep ‘--after-context=num’ Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

3. Shell Programming and Scripting

Print lines between two lines after grep for a text string

I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like: <ROW> some information more information </ROW> I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies

4. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

5. Shell Programming and Scripting

Print lines before and after..not grep -A

Hi I have this in my file 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11... (9 Replies)
Discussion started by: zorrox
9 Replies

6. Shell Programming and Scripting

Grep and print next 10 Lines separated by ,

Hi All, I need to grep through a file for a string and print the next ten lines to a file separating the lines with a , and save it as a csv file to open it as a XL file. The 10 lines should be on a sigle row in xl. Any suggesstions please. Note; I dont have a GNU Grep to use -A flag. ... (6 Replies)
Discussion started by: Nani369
6 Replies

7. Shell Programming and Scripting

Print lines between two strings multiple occurencies (with sed, awk, or grep)

Hello, I can extract lines in a file, between two strings but only one time. If there are multiple occurencies, my command show only one block. Example, monfichier.txt contains : debut_sect texte L1 texte L2 texte L3 texte L4 fin_sect donnees inutiles 1 donnees inutiles 2 ... (8 Replies)
Discussion started by: theclem35
8 Replies

8. AIX

Print output of grep command in multuple lines

HI All, I am using grep command to serach a pattern in a list of files and storing the output in a variable. Then i am applying some logic on that variable to get the required output. But Thing is that when the pattern is present mutiple times in a file, i am getting the output of grep in a... (3 Replies)
Discussion started by: goutam sahoo
3 Replies

9. Shell Programming and Scripting

Parsing OSX UNIX command results which print in multiple lines

from the CLI on a Mac, if you type networksetup -listallnetworkservices then you get results in a multi-line paragraph that look something like this: networksetup -listallnetworkservices An asterisk (*) denotes that a network service is disabled. Wi-Fi Display Ethernet Bluetooth DUN... (7 Replies)
Discussion started by: hungryd
7 Replies
vacation(1)						      General Commands Manual						       vacation(1)

NAME
vacation - return "I am not here" indication SYNOPSIS
alias]... login DESCRIPTION
The program returns a message to the sender of a message telling them that you are currently not reading your mail. The intended use is in a file in For example, your file might contain: which would send messages to you (assuming your login name was and reply to any messages for or The preceding is required to force direct delivery to mailbox and prevent an infinite loop through the file. The double quotes are needed to tell sendmail(1M) to treat the enclosed as a unit, rather than separate recipients. It is also important to specify the full path for the vacation program, and there must be no white space between the character and the start of the path name. No message is sent unless login or an alias supplied using the option is a substring of either the or headers of the mail. No messages from or are replied to, nor is a notification sent if a or line is included in the mail headers. Only one message per week is sent to each unique sender (at each unique host system). The people who have sent you messages are recorded in a database in the files and in your home directory. The program expects a file in your home directory, containing a message to be sent back to each sender. It should be an entire message (including headers). For example, it might say: >From: eric@ucbmonet.Berkeley.EDU (Eric Allman) Subject: I am on vacation X-Delivered-By-The-Graces-Of: The vacation program Precedence: bulk I am on vacation until July 22. If you have something urgent, please contact Joe Kalash <kalash@ucbingres.Berkeley.EDU>. --eric Header lines in this file must be left-aligned and must not be preceded by any other lines, including blank lines (see sendmail(1M)). If there is no file, uses the following file (if it exists): Otherwise, it logs an error. reads the first line from the standard input (the incoming mail message in the example file above) for a UNIX style line to determine the sender. sendmail(1M) includes this line automatically, and its absence indicates non-mail input. Options The program supports the following options: Initializes the vacation database files. This option should be used before modifying a file. Identifies another name that can legitimately appear in the line of the mail header instead of your login name. More than one option can be specified. EXTERNAL INFLUENCES
Environment Variables determines the language in which error messages are printed. DIAGNOSTICS
On error, exits with a value from and causes to report an error back to the sender of the original message. Errors such as the absence of or calling with incorrect arguments, are logged using on the system where actually runs (see syslogd(1M)). The file by default; see and syslogd(1M) for customizations) should be inspected when generates mailer error messages. Remember that if the machine is configured for shared mail, inbound mail is handled at the mail server rather than on mail client nodes. This means that diagnostics appear in the mail server's not the client's WARNINGS
Errors in the file can lead to loss of mail and infinite mail loops. Always send test mail to yourself after configuring to be sure that it is working properly. This is akin to checking telephone forwarding before leaving for an extended period, and can prevent loss of messages. Some mail recipients look for an RFC 822 compliant header in their incoming mail messages. Such recipients have to set the option to in the configuration file, AUTHOR
was developed by Eric Allman and the University of California, Berkeley. FILES
Database file. Message to send. Database file. System-wide default header and message. Dictates where error messages are recorded. SEE ALSO
sendmail(1M), syslogd(1M), ndbm(3X). vacation(1)
All times are GMT -4. The time now is 04:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy