Sponsored Content
Top Forums Shell Programming and Scripting inserting and replacing lines with awk Post 302530132 by krishve on Monday 13th of June 2011 03:56:03 AM
Old 06-13-2011
i have to do the below tasl using script.

please help

Disable the "EXPN" and "VRFY" commands in your current version of the "sendmail" command. A
malicious user able to connect to a machine running sendmail may be able to acquire information
about user accounts on that system
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Inserting specific lines in vi

How can I insert, say lines 500 - 700 from another file into the current file on the current line (cursor) that I am editing while in vi (AIX). I know how to insert the entire file but how do you do it when you only need certain lines from a huge file? I've referenced my Unix Unleash book but... (2 Replies)
Discussion started by: giannicello
2 Replies

2. Shell Programming and Scripting

inserting a lines in a file

Hi folks, i need to insert the same set of lines between each line input lines 111111 aaaaaa 333333 output should be 111111 1 2 3 aaaaaa 1 2 3 333333 1 (2 Replies)
Discussion started by: Balaji Sukumara
2 Replies

3. Shell Programming and Scripting

inserting lines

Hi I would like to add lines to a file at specific locations. eg: If I have a file containing data... ABC DEF GHIJKLKMNOP RSTUVWXYZ and I have a requirement to insert a lines a) "LINE_FIRST" before first line in the file b) "LINE_X" before third line in the file c) "LINE_LAST"... (2 Replies)
Discussion started by: tostay2003
2 Replies

4. Shell Programming and Scripting

Replacing lines between two files with awk

Hello Masters, I have two subtitles file with different language like below First file : 1 00:00:41,136 --> 00:00:43,900 2 00:00:55,383 --> 00:00:58,477 <i> Ladies and gentlemen,</i> <i>this is Simon Barsinister,</i> 3 00:00:58,553 --> 00:01:00,521 <i>the wickedest man in the... (8 Replies)
Discussion started by: rk4k
8 Replies

5. Shell Programming and Scripting

inserting multiple lines with awk

awk '/<login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">/{p++} /<login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient">/ && p==1 {$0="Mulitple lines here\n"$0}1' login-config.xml In the above awk code inside shell script, i am having problems when... (1 Reply)
Discussion started by: sunrexstar
1 Replies

6. Shell Programming and Scripting

Help in replacing two blank lines with two lines of diff data

Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script... I used sed to search a line and insert two blank lines after the searchd line using the following sed command. sed "/data/{G;G;}/" filename . In the file, after data tag, two lines got inserted blank lines..... (4 Replies)
Discussion started by: arjun_arippa
4 Replies

7. UNIX for Dummies Questions & Answers

Finding lines with a regular expression, replacing them with blank lines

So the tag for this forum says all newbies welcome... All I want to do is go through my file and find lines which contain a given string of characters then replace these with a blank line. I really tried to find a simple command to do this but failed. Here's what I did come up with though: ... (2 Replies)
Discussion started by: Golpette
2 Replies

8. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

9. Shell Programming and Scripting

Replacing lines matching a multi-line pattern (sed/perl/awk)

Dear Unix Forums, I am hoping you can help me with a pattern matching problem. What am I trying to do? I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies

10. Shell Programming and Scripting

Merging multiple lines to columns with awk, while inserting commas for missing lines

Hello all, I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person. In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies
insdelln(3XCURSES)					  X/Open Curses Library Functions					insdelln(3XCURSES)

NAME
insdelln, winsdelln - insert/delete lines to/from the window SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int insdelln(int n); int winsdelln(WINDOW *win, int n); PARAMETERS
n Is the number of lines to insert or delete (positive n inserts; negative n deletes). win Is a pointer to the window in which to insert or delete a line. DESCRIPTION
The insdelln() and winsdelln() functions insert or delete blank lines in stdscr or win, respectively. When n is positive, n lines are added before the current line and the bottom n lines are lost; when n is negative, n lines are deleted starting with the current line, the remaining lines are moved up, and the bottom n lines are cleared. The position of the cursor does not change. RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR. ERRORS
None. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
deleteln(3XCURSES), insertln(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 insdelln(3XCURSES)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy