Sponsored Content
Top Forums Shell Programming and Scripting replace only 1st word of a line if it comes in the subsequent lines at same postion. Post 302137423 by vino on Tuesday 25th of September 2007 03:06:58 AM
Old 09-25-2007
Two users with the same requirement! Is it homework ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to replace the first word of a line if it occurs again in the next line(shell)

Hi folks, have a look into the attachment, i am not familiar with unix, can you please help me in this regard. thanks in advance, :) regards, Geeko (4 Replies)
Discussion started by: geeko
4 Replies

2. Shell Programming and Scripting

How to search for keywords in subsequent lines

Hi all, I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line. Once i found the combination ineed to print the lines with patterns and the line above and one below. I am giving an example here: Keywords are :ERROR and... (12 Replies)
Discussion started by: rdhanek
12 Replies

3. Shell Programming and Scripting

search for keyword in subsequent lines and delete the second line

I have my data something like this I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword. In other words, if a keywords is found in two subsequent lines delete the second line. input data: aaaa bbbbb cccc dddd xxxx... (4 Replies)
Discussion started by: rdhanek
4 Replies

4. Shell Programming and Scripting

Grep and fetch subsequent lines also

Hi, I need to grep a pattern and fetch subsequent lines till end of the data-set. E.g., i have a file like: AA 1111 23 34 BB 45 56 78 CC 22 44 AA 2222 78 34 56 BB 22 56 67 68 23 CC 56 78 DD 33 55 77 AA 3333 46 BB 58 79 In above file i have 3-data sets where each set starts with... (6 Replies)
Discussion started by: prvnrk
6 Replies

5. Shell Programming and Scripting

awk - use fields from subsequent lines

I've run into a problem getting exactly what I want out of awk - some folks may recognize this as an output from Amazon's ec2-describe-instances: Given the following: INSTANCE i-4960f321 BLOCKDEVICE Line2Var2 TAG instance i-4960f321 Name web1 TAG instance i-4960f321... (2 Replies)
Discussion started by: colinjohnson
2 Replies

6. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

7. UNIX for Advanced & Expert Users

Need command for grepping pattern lines with subsequent lines

Hi, I have a requirement like, I have a list of pattens in a file say pattern.txt, PHC111 PHC113 and in another file called master.lst i have entries like, PHC111 a b PHC112 a PHC113 b c PHC114 d e (5 Replies)
Discussion started by: rbalaj16
5 Replies

8. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies

9. UNIX for Beginners Questions & Answers

Replace only First Word in Line

I have query to replace the first word in line using below code but its replace the middle word too sed -i 's/load /# LOAD/' /tmp/check.sql Query 1 : UPDATE accheadcon_data_last_upload SET last_upload_date = '2017-07-23' Replace to UPDATE accheadcon_data_last_up# LOAD SET... (1 Reply)
Discussion started by: kaushik02018
1 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
CONTROL.CTL(5)							File Formats Manual						    CONTROL.CTL(5)

NAME
control.ctl - specify handling of Usenet control messages DESCRIPTION
The file /etc/news/control.ctl is used to determine what action is taken when a control message is received. It is read by the parsecon- trol script, which is called by all the control scripts. (For an explanation of how the control scripts are invoked, see innd(8).) The file consists of a series of lines; blank lines and lines beginning with a number sign (``#'') are ignored. All other lines consist of four fields separated by a colon: message:from:newsgroups:action The first field is the name of the message for which this line is valid. It should be either the name of the control message, or the word ``all'' to mean that it is valid for all messages. The second field is a shell-style pattern that matches the email address of the person posting the message. (The poster's address is first converted to lowercase.) The matching is done using the shell's case statement; see sh (1) for details. If the control message is ``newgroup'' or ``rmgroup'' then the third field specifies the shell-style pattern that must match the group being created or removed. If the control message is of a different type, then this field is ignored. The fourth field specifies what action to take if this line is selected for the message. The following actions are understood: doit The action requested by the control message should be performed. In most cases the control script will also send mail to usenet. doifarg If the control message has an argument, this is treated as a ``doit'' action. If no argument was given, it is treated as a ``mail'' entry. This is used in ``sendsys'' entries script so that a site can request its own newsfeeds(5) entry by posting a ``sendsys mysite'' article. On the other hand, sendsys ``bombs'' ask that the entire newsfeeds file be sent to a forged reply-to address; by using ``doifarg'' such messages will not be processed automatically. doit=file The action is performed, but a log entry is written to the specified log file, file. If file is the word ``mail'' then the record is mailed. A null string is equivalent to /dev/null. A pathname that starts with a slash is taken as the absolute filename to use as the log. All other pathnames are written to /var/log/news/file.log. The log is written by writelog (see newslog(8)). drop No action is taken; the message is ignored. log A one-line log notice is sent to standard error. Innd normally directs this to the file /var/log/news/errlog. log=file A log entry is written to the specified log file, file, which is interpreted as described above. mail A mail message is sent to the news administrator. Lines are matched in order; the last match found in the file is the one that is used. For example, with the following three lines: newgroup:*:*:drop newgroup:tale@*.uu.net:comp.*|misc.*|news.*|rec.*|sci.*|soc.*|talk.*:doit newgroup:kre@munnari.oz.au:aus.*:mail A newgroup coming from ``tale'' at a UUNET machine will be honored if it is in the mainstream Usenet hierarchy. If ``kre'' posts a new- group message creating ``aus.foo'', then mail will be sent. All other newgroup messages are ignored. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.8, dated 1996/09/06. SEE ALSO
innd(8), newsfeeds(5), scanlogs(8). CONTROL.CTL(5)
All times are GMT -4. The time now is 01:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy