Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to delete line with matching text and line immediately after Post 302157643 by drl on Friday 11th of January 2008 03:59:12 PM
Old 01-11-2008
Hi, gus2000.

The man page for the GNU version did not say that that was an extension. I'll try to see if that's POSIX. The version on FreeBSD 4.1 man page:
Quote:
The sed utility is expected to be a super-set of the IEEE Std 1003.2
(``POSIX.2'') specification.
and the "+1" syntax also did not work there ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete last line from text file

I have a file with which i must remove the last line of the file (the footer). I know how to copy and redirect with tail -1 etc, but how do i delete it permanentely (4 Replies)
Discussion started by: hcclnoodles
4 Replies

2. Shell Programming and Scripting

Delete first line from any text file ?

What command I can use to delete first line from any text file ? Thk (5 Replies)
Discussion started by: aungomarin
5 Replies

3. Shell Programming and Scripting

how to delete text from line starting pattern1 up to line before pattern2?

My data is xml'ish (here is an excerpt) :- <bag name="mybag1" version="1.0"/> <contents id="coins"/> <bag name="mybag2" version="1.1"/> <contents id="clothes"/> <contents id="shoes"/> <bag name="mybag3" version="1.6"/> I want to delete line containing mybag2 and its subsequent... (5 Replies)
Discussion started by: repudi8or
5 Replies

4. UNIX for Dummies Questions & Answers

Delete line in text file

Hi, How do I go about deleting a line in a text file. I have used grep to find a particlular word, now how do I delete the line? so far I got: grep -i $keyword file.txt (6 Replies)
Discussion started by: Berserk
6 Replies

5. Shell Programming and Scripting

how to delete a matching line from a file

I have file A with 10 lines and file B with 15 lines I have to read each line from file A and match it with lines in file B If matching lines are found i need to delete it from file B The ouput will be the deleted file B I tried the following in the loop but the deleting part is not... (5 Replies)
Discussion started by: codeman007
5 Replies

6. Shell Programming and Scripting

sed find matching pattern delete next line

trying to use sed in finding a matching pattern in a file then deleting the next line only .. pattern --> <ad-content> I tried this but it results are not what I wish sed '/<ad-content>/{N;d;}' akv.xml > akv5.xml ex, <Celebrant2First>Mickey</Celebrant2First> <ad-content> Minnie... (2 Replies)
Discussion started by: aveitas
2 Replies

7. UNIX for Dummies Questions & Answers

How to delete one line from a text file

PATTERN="" sed "/$PATTERN/d" $file In the file data is stored as ::: ::: I need to delete only the line containing the PATTERN pls help to point out why the above code is not working (4 Replies)
Discussion started by: thomsandy
4 Replies

8. Shell Programming and Scripting

sed or awk delete character in the lines before and after the matching line

Sample file: This is line one, this is another line, this is the PRIMARY INDEX line l ; This is another line The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies

9. UNIX for Dummies Questions & Answers

How to delete text between two characters in line?

Hi, I have a large text file with the following format: >gi|347545744|gb|JN204951.1| Dismorphia spio voucher 5 ATCAAATTCCTTCCTCTCCTTAAA >gi|17544664774|gb|WN204922.32| Rodapara nigens gene region CCGGGCAAATTCCTTCCTCTCCTTAAA >gi|555466400|gb|SG255122.8| Bombyx mandariana genbank 3... (1 Reply)
Discussion started by: euspilapteryx
1 Replies

10. Shell Programming and Scripting

awk to add text to each line of matching id

The awk below executes as expected if the id in $4 (like in f) is unique. However most of my data is like f1 where the same id can appear multiple times. I think that is the reason why the awk is not working as expected. I added a comment on the line that I can not change without causing the script... (6 Replies)
Discussion started by: cmccabe
6 Replies
curs_outopts(3CURSES)					     Curses Library Functions					     curs_outopts(3CURSES)

NAME
curs_outopts, clearok, idlok, idcok, immedok, leaveok, setscrreg, wsetscrreg, scrollok, nl, nonl - curses terminal output option control routines SYNOPSIS
cc [ flag ... ] file ... -lcurses [ library ... ] #include <curses.h> int clearok(WINDOW *win, bool bf); int idlok(WINDOW *win, bool bf); void idcok(WINDOW *win, bool bf); void immedok(WINDOW *win, bool bf); int leaveok(WINDOW *win, bool bf); int setscrreg(int top, int bot); int wsetscrreg(WINDOW *win, int top, int bot); int scrollok(WINDOW *win, bool bf); int nl(void); int nonl(void); DESCRIPTION
These routines set options that deal with output within curses. All options are initially FALSE, unless otherwise stated. It is not neces- sary to turn these options off before calling endwin(). With the clearok() routine, if enabled (bf is TRUE), the next call to wrefresh() with this window will clear the screen completely and redraw the entire screen from scratch. This is useful when the contents of the screen are uncertain, or in some cases for a more pleasing visual effect. If the win argument to clearok() is the global variable curscr(), the next call to wrefresh() with any window causes the screen to be cleared and repainted from scratch. With the idlok() routine, if enabled (bf is TRUE), curses considers using the hardware insert/delete line feature of terminals so equipped. If disabled (bf is FALSE) , curses very seldom uses this feature. (The insert/delete character feature is always considered.) This option should be enabled only if the application needs insert/delete line, for example, for a screen editor. It is disabled by default because insert/delete line tends to be visually annoying when used in applications where it isn't really needed. If insert/delete line cannot be used, curses redraws the changed portions of all lines. With the idcok() routine, if enabled (bf is TRUE), curses considers using the hardware insert/delete character feature of terminals so equipped. This is enabled by default. With the immedok() routine, if enabled (bf is TRUE), any change in the window image, such as the ones caused by waddch(), wclrtobot(), wscrl(), etc., automatically cause a call to wrefresh(). However, it may degrade the performance considerably, due to repeated calls to wrefresh(). It is disabled by default. Normally, the hardware cursor is left at the location of the window cursor being refreshed. The leaveok() option allows the cursor to be left wherever the update happens to leave it. It is useful for applications where the cursor is not used, since it reduces the need for cursor motions. If possible, the cursor is made invisible when this option is enabled. The setscrreg() and wsetscrreg() routines allow the application programmer to set a software scrolling region in a window. top and bot are the line numbers of the top and bottom margin of the scrolling region. (Line 0 is the top line of the window.) If this option and scrol- lok() are enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll up one line. Only the text of the window is scrolled. (Note that this has nothing to do with the use of a physical scrolling region capability in the terminal, like that in the VT100. If idlok() is enabled and the terminal has either a scrolling region or insert/delete line capability, they will probably be used by the output routines.) The scrollok() option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If disabled, (bf is FALSE), the cursor is left on the bottom line. If enabled, (bf is TRUE), wrefresh() is called on the window, and the physical terminal and window are scrolled up one line. (Note that in order to get the physical scrolling effect on the terminal, it is also necessary to call idlok().) The nl() and nonl() routines control whether newline is translated into carriage return and linefeed on output, and whether return is translated into newline on input. Initially, the translations do occur. By disabling these translations using nonl(), curses is able to make better use of the linefeed capability, resulting in faster cursor motion. RETURN VALUES
setscrreg() and wsetscrreg() return OK upon success and ERR upon failure. All other routines that return an integer always return OK. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
curs_addch(3CURSES), curs_clear(3CURSES), curs_initscr(3CURSES), curs_refresh(3CURSES), curs_scroll(3CURSES), curses(3CURSES), attributes(5) NOTES
The header <curses.h> automatically includes the headers <stdio.h> and <unctrl.h>. Note that clearok(), leaveok(), scrollok(), idcok(), nl(), nonl(), and setscrreg() may be macros. The immedok() routine is useful for windows that are used as terminal emulators. SunOS 5.11 31 Dec 1996 curs_outopts(3CURSES)
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy