Sponsored Content
Operating Systems AIX Print nth previous line after match Post 302970046 by Don Cragun on Friday 1st of April 2016 12:42:26 AM
Old 04-01-2016
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did post homework in this forum, please review the guidelines for posting homework and repost.

Otherwise, please:
  1. explain why you need to do this,
  2. show us what you have tried to solved this on your own,
  3. show us sample input and corresponding desired output, and
  4. tell us what operating system and shell you're using.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

return previous line for pattern match

Hi, Need some idea on file processing, I have file like below, Processing al sources ... ...No value found : CHECK. Completed comparing all sources. Comparing schedulers... Processing al targets ... ...No value found : From above I need to extract the line where "No value... (4 Replies)
Discussion started by: braindrain
4 Replies

2. Shell Programming and Scripting

Getting filename for Nth line pattern match

Hi, I have many scripts in particular directory. And few of the scripts have exit 0 in second line. Now i wanted to list out the scripts name which has the exit 0 in its second line I tried many options , but i can not get the filename along with the nth line pattern match :mad:. Can anyone... (14 Replies)
Discussion started by: puni
14 Replies

3. Shell Programming and Scripting

search pattern and replace x-y characters in nth line after every match

Hi, I am looking for any script which can do the following. have to read a pattern from fileA and copy it to fileB. fileA: ... ... Header ... ... ..p1 ... ... fileB: .... .... Header (3 Replies)
Discussion started by: anilvk
3 Replies

4. Shell Programming and Scripting

Delete line with match and previous line quoting/escaping problem

Hi folks, I've list of LDAP records in this format: cat cmmac.export.tmp2 dn: deviceId=0a92746a54tbmd34b05758900131136a506,ou=devices,ou=customer,ou=nl,o=upc cmmac: 00:13:11:36:a5:06 dn: deviceId=0a92746a62pbms4662299650015961cfa23,ou=devices,ou=customer,ou=nl,o=upc cmmac:... (4 Replies)
Discussion started by: tomas.polak
4 Replies

5. Shell Programming and Scripting

Print every nth line

Dear all, How to print every nth line. File like this: File input: 1 1 1 1 1 1 2 2 2 3 3 3 3 3 3 (3 Replies)
Discussion started by: attila
3 Replies

6. UNIX for Dummies Questions & Answers

Printing nth and n+1th line after a pattern match

Hi , I want to print the nth and n+1 lines from a file once it gets a pattern match. For eg: aaa bbb ccc ddd gh jjjj If I find a match for bbb then I need to print bbb as well as 3rd and 4th line from the match.. Please help..Is it possible to get a command using sed :) (6 Replies)
Discussion started by: saj
6 Replies

7. Shell Programming and Scripting

Print nth line in a file

Bash/Oracle Linux 6.4 A basic requirement. How can I get nth line of a file printed ? Can I use grep in this case ? Example: In the below file, 12th line is "Kernel parameter check passed for rmem_max" . I just want the 12 line to be printed. # cat sometext.txt Kernel version check... (2 Replies)
Discussion started by: John K
2 Replies

8. Shell Programming and Scripting

How to display when nth line match a pattern?

Hi All, I have sample of listing as following Database 2 entry: Database alias = PXRES Database name = PXRES Local database directory = /db2/data1/db2phnx Database release level = d.00 Comment ... (3 Replies)
Discussion started by: ckwan
3 Replies

9. Shell Programming and Scripting

How to delete the previous line after pattern match?

Team, I am writing a shell script to perform few health checks of the system, where I need to delete the previous line in the text file after pattern match using sed (or) awk. Could you please help me out on this? For example, <td> <td style=color:green align=center> </td> </tr>... (6 Replies)
Discussion started by: Nagaraj R
6 Replies

10. UNIX for Beginners Questions & Answers

awk or sed to print the character from the previous line after the regexp match

Hi All, I need to print the characters in the previous line just before the regular expression match Please have a look at the input file as attached I need to match the regular expression ^ with the character of the previous like and also the pin numbers and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
FORUM(1)							       mrtg								  FORUM(1)

NAME
forum - Interactive Help for MRTG users SYNOPSIS
There is a lot of written documentation for mrtg. But never the less you may have a problem where you can't find the solution. In this case some Human Help may be necessary. With MRTG there are several ways to get Humans to help you. MAILING-LIST There are three mailing lists for MRTG available. mrtg for discussion among mrtg users mrtg-announce for announcements regarding new versions of mrtg related software mrtg-developers for discussion among people who write software in connection with mrtg or who hack mrtg itself. THE RULES Please note, that the memebers of the mrtg mailinglist value politeness highly. This means behave in a way you would like others to behave towards you. o No shouting. (NO CAPS) o No rude language o No demands. everybody is on the list out of their own free will. If you do not get an answer to your question, chances are high that you did not give sufficent details about the nature of your problem or that the answer to your problem is in the documentation. o If you do not follow the rules you will be unsubscribed from the list with no further questions asked. o Decisions about your unsubscription from the list will be taken by Alex van den Bogaerdt <alex@slot.hollandcasino.nl> Paul C. Williamson <pwilliamson@MANDTBANK.COM> If you feel that you have been treated unfairly, you may send mail to me and explain the situation. Tobi Oetiker <oetiker@ee.ethz.ch> SUBSCRIBING These lists are managed by a mailing-list management software (listar). It allows you to subscribe to these lists by sending a message with the subject: subscribe to the following address: listname-request@list.ee.ethz.ch You will then get a message asking you to confirm your subscription. For posting to the lists use the following address listname@list.ee.ethz.ch Note that only people who are subscribed to the list can post. Further information about the usage of the mailing lists is available by sending a message with the subject line help to either one of the request addresses. For past activity there is also a mailing list archive available: http://www.ee.ethz.ch/~slist/mrtg There is also a web interface to manage your mailing-list subscription. http://www.ee.ethz.ch/~slist/lsg2.cgi NEWSGROUP
For discussion of MRTG or related topics on the Usenet, please send your posts to: news:comp.dcom.net-management Many MRTG users are in this forum and will help you. You can also find an archive of past activity from this Newsgroup on: http://www.deja.com/usenet AUTHOR
Tobias Oetiker <oetiker@ee.ethz.ch> and many contributors 3rd Berkeley Distribution 2.9.17 FORUM(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy