Sponsored Content
Full Discussion: Scanning file backwards
Top Forums UNIX for Advanced & Expert Users Scanning file backwards Post 302137072 by pseudocoder on Friday 21st of September 2007 05:07:20 PM
Old 09-21-2007
Is there any way to look for the keyword "vendor" and scan "backwards" to find the path/file

Code:
$ man grep

check the -B num option

ps: sorry if i didn't understand your problem Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scanning for '0' value in .txt file

Hello I am a novice shell scripting programmer, so please bare with me. I have embedded a simple SQL statement into a shell script, which simply returns an integer (its a count (*) statement). The result of the statement is then oputput to .txt file. So, the number could be 0, 1,2, 10,... (4 Replies)
Discussion started by: man80
4 Replies

2. Shell Programming and Scripting

How to zip a modified file 15 days before but not scanning my sub directory files

I am using zip -m option to zip my files, but i dont want my sub directories files to be zipped (1 Reply)
Discussion started by: skrish70
1 Replies

3. Shell Programming and Scripting

read file backwards

Assume file1 contains a list of strings. My first script is scanning the file and deals with the lines with a certain patern in it: grep 'somepatern' file1 \ while read LINE ; do doSomethingAboutIt done Now, I need a second script that deals with the same lines (& do something... (3 Replies)
Discussion started by: bluemoon1
3 Replies

4. Shell Programming and Scripting

How to search backwards in a log file by timestamp of entries?

Hello. I'm not nearly good enough with awk/perl to create the logfile scraping script that my boss is insisting we need immediately. Here is a brief 3-line excerpt from the access.log file in question (actual URL domain changed to 'aaa.com'): 209.253.130.36 - - "GET... (2 Replies)
Discussion started by: kevinmccallum
2 Replies

5. Shell Programming and Scripting

Backwards question mark appearing in FTP'd file

Hi all, I'm trying to FTP what looks like a simple .txt file from my Windows XP desktop to my UNIX server. I've tried using several programs to do this including UltraEdit and FTP Commander. I have tried sending it ascii, binary and even let the program decide. But every time it arrives in UNIX... (4 Replies)
Discussion started by: Korn0474
4 Replies

6. UNIX for Dummies Questions & Answers

scanning the file for a particular column

I have a file containing 4 columns. need to scan that file, if all the rows in the column4 have a value ZERO, it should print "everything is fine". And if all are not ZERO , at the first encounter of non ZERO value of 4th column it should print "some problem " may be a silly question, but at... (11 Replies)
Discussion started by: gotam
11 Replies

7. Programming

How to search a file based on a time stamp backwards 10 seconds

Hi all, I'm after some help with this small issue which i'm struggling to work out a fix for. I have a file that contains records that all have a time stamp for each individual record, i need to search the file for a specific time stamp and then search back 10 seconds to see if the number... (2 Replies)
Discussion started by: sp3arsy
2 Replies

8. Shell Programming and Scripting

Reg scanning time based log file

Hi, I have a requirement to scan Oracle's alert log file. This file logs all event for Oracle database and each line will have timestamp followed by messages (which might be one or more lines). Example. Thu Aug 15 17:35:59 2013 VKTM detected a time drift. Please check trace file for more... (1 Reply)
Discussion started by: manickaraja
1 Replies

9. Shell Programming and Scripting

Scanning a pdf file in Linux shell

I want to search a keyword in a list of pdf files and when i find a match i want to write the title and author of that pdf file to another file. How will I do this using linux shell script? (7 Replies)
Discussion started by: SK33
7 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 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:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy