Sponsored Content
Top Forums Shell Programming and Scripting Multiple selective keyword Report Post 303028625 by rbatte1 on Friday 11th of January 2019 10:44:14 AM
Old 01-11-2019
Hello ckwan,

After 60 posts, I'd hope you could help us out a little here. I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • Are the line numbers to display meant to just be sequential in the output or to represent the line it is found in the input?
    • Where you have two items found being written on the same output line, which input line would you want it to refer to?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin
These 2 Users Gave Thanks to rbatte1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multiple search keyword in grep

Dear All, I have a file containing info like TID:0903 asdfasldjflsdjf TID:0945 hjhjhkhkhkh TID:2045 hjhjhkhkhkh TID:1945 hjhjhkhkhkh TID:2045 hjhjhkhkhkh I need to show only lines containing TID:0903 asdfasldjflsdjf TID:0945 hjhjhkhkhkh TID:2045 hjhjhkhkhkh TID:2045 hjhjhkhkhkh ... (11 Replies)
Discussion started by: saifurshaon
11 Replies

2. Shell Programming and Scripting

Selective input passing, for cron with multiple interval

0,0 4,5 11 11 * /pkgs/roots/scripts/job_monitor.ksh i have the requirement like, for the first time(4) the script should have the input parameter as "Value1" but the second time(5) it should have the input parameter as "Value2" Can we achieve this using any cron options ? If yes, How..??... (2 Replies)
Discussion started by: vikram3.r
2 Replies

3. Shell Programming and Scripting

How to convert 2 column data into multiple columns based on a keyword in a row??

Hi Friends I have the following input data in 2 columns. SNo 1 I1 Value I2 Value I3 Value SNo 2 I4 Value I5 Value I6 Value I7 Value SNo 3 I8 Value I9 Value ............... ................ SNo N (1 Reply)
Discussion started by: ks_reddy
1 Replies

4. Shell Programming and Scripting

Removing Multiple lines below a keyword using SED?

I have 9,000 + html files. I am using the following to remove the content from a certain line up for i in `ls` do sed '1,569d' $i > $i.bak done This will remove the unwanted formatting keeping the content I need which changes in each HTML file. the problem I have now is that the... (2 Replies)
Discussion started by: deaconf19
2 Replies

5. Shell Programming and Scripting

Need to develop a script to create a report reading multiple server logs

I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Discussion started by: scriptingnewbie
5 Replies

6. UNIX for Dummies Questions & Answers

selective grep

Hello, I have been using the command below for file manipulation. while read A B; do grep $f1; done < f2 > f3 So, if a certain string is found in f2 (for ex; DOG243435) and it is also present in f1, then print that string plus the contents of the line in which it was found onto f3. ... (6 Replies)
Discussion started by: verse123
6 Replies

7. UNIX for Dummies Questions & Answers

Help with selective ls

Hi all :wall: Can anyone advise how do I use ls to do a selective amd sorted listing of file that I want to have as below? Am looking for files that are named as log_<nnnn>.txt, where <nnnn> are numeric, i.e. I want to have a listing sorted from the newest to the oldest of files that... (7 Replies)
Discussion started by: newbie_01
7 Replies

8. Shell Programming and Scripting

Selective grouping

I have a text file in this format. Group: AAA Notes: IP : 11.11.11.11 #User xxxxxxxxx #Password aaaaaaaaaaaaaaaa Group: AAA Notes: IP : 11.11.11.22 #User yyyyyyyyyyyyy #Password bbbbbbbbbbbbb (8 Replies)
Discussion started by: anil510
8 Replies

9. Shell Programming and Scripting

Need help: Script to report timestamp of directories in a specific path from multiple Linux server

Need help Please help on how to write a script which can echo timestamp, size of subdirectories in a specific path from multiple Linux servers to a text file. I can ssh with a common user to all the servers from a build box. Basic idea what I had was: ssh <commonuser>@<each box> cd... (1 Reply)
Discussion started by: sudhichadaga
1 Replies

10. Shell Programming and Scripting

Search for a Keyword in file and replace another keyword or add at the end of line

Hi I want to implement something like this: if( keyword1 exists) then check if(keyword2 exists in the same line) then replace keyword 2 with New_Keyword else Add New_Keyword at the end of line end if eg: Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies
NEWS.DAILY(8)						      System Manager's Manual						     NEWS.DAILY(8)

NAME
news.daily - do regular Usenet system administration SYNOPSIS
news.daily [ keyword... ] DESCRIPTION
News.daily performs a number of important Usenet administrative functions. This includes producing a status report, removing old news articles, processing log files, rotating the archived log files, renumbering the active file, removing any old socket files found in the ``firewall'' directory, and collecting the output. This program should be run under the news administrator's id, not as root. By default, news.daily performs all of its functions and mails the output to the news administrator, usenet. By specifying ``keywords'' on the command line, it is possible to modify the functions performed, as well as change the arguments given to expire(8) and expireover(8). News.daily should be run once a day, typically out of cron(8). It may be run more often, but such invocations should at least use the ``notdaily'' keyword to prevent the log files from being processed and rotated too fast. The shlock(1) program is used to prevent simultaneous executions. KEYWORDS
The following keywords may be used: delayrm This uses the ``-z'' flag when invoking expire and expireover. The names of articles to be removed are written to a temporary file, and then removed after expiration by calling expirerm(8). expctl=path Specify the file to use as the expire.ctl(5) file for expire. expdir=path By default, expire builds the new history(5) file and database in the same directory as the current files. Using this keyword spec- ifies a different local to build the new files (by passing the ''-d'' flag to expire), which will then be moved to the right loca- tion when finished. nostat This keyword disables the status report generated by innstat (see newslog(8)). Without this keyword, the status report is the first function performed, just prior to obtaining the news.daily lock. notdaily By default news.daily expects to be run only once a day. Use this keyword any extra times news.daily is run in the day and the nor- mal logfile processing (and rotation) will not be done. noexpire By default, expire is invoked to remove old news articles. Using this keyword disables this function. noexplog Expire normally appends information to /var/log/news/expire.log (see newslog(5)). Using this keyword causes the expire output to be handled as part of news.daily's output. It has no effect if the ``noexpire'' keyword is used. flags='expire args' By default, expire is invoked with the an argument of ``-v1''. Using this keyword changes the arguments to those specified. Be careful to use quotes if multiple arguments are needed. This keyword has no effect if the ``noexpire'' keyword is used. nologs After expiration, scanlogs(8) is invoked to process the log files. Using this keyword disables all log processing functions. norotate By default, log processing includes rotating and cleaning out log files. Using this keyword disables the rotating and cleaning aspect of the log processing: the logs files are only scanned for information and no contents are altered. This keyword has no effect if the ``nologs'' keyword is used. The ``norotate'' keyword is passed on to scanlogs if it is invoked. norenumber This keyword disables the ctlinnd(8) renumber operation. Normally, the low-water mark for all newsgroups (see active(5)) is reset. norm By default, any socket ctlinnd socket that has not been modified for two days will be removed. Using this keyword disables this function. nomail News.daily normally sends a mail message containing the results to the administrator. Using this keyword causes this message to be sent to stdout and stderr instead. Normally, all utilities invoked by the script have their stdout and stderr redirected into a file. If the file is empty, no message is sent. expireover The expireover program is called after expiration to purge the overview databases. expireoverflags='expireover args' If the ``expireover'' keyword is used, this keyword may be used to specify the flags to be passed to expireover. If the ``delayrm'' keyword is used, then the default value is ``-z'' and the list of deleted files; otherwise, the default value is ``-s''. /full/path The program specified by the given path is executed just before any expiration is done. A typical use is to specify an alternate expiration program and use the ``noexpire'' keyword. Multiple programs may be specified; they will be invoked in order. HISTORY
News.daily and this manual page written by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net>. This is revision 1.11, dated 1996/12/10. SEE ALSO
active(5), ctlinnd(8), expire(8), fastrm(8), newslog(5), newslog(8), innwatch.ctl(5), shlock(1). NEWS.DAILY(8)
All times are GMT -4. The time now is 04:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy