I want to compare the last line and the 2.nd line from the bottom later with a calculation. The rest of the script is working. What is wrong with my solution?
I want to take the 2nd line from the bottom. And I do not know the command.
TAIL -2 is wrong because it takes the 2 bottom lines.
So I tried to take the 2 lines from the bottom with tail -2 and later the 1. line with head -1.
Hi,
i have a small requirement where i have to get the bottom most line from a file to the topmost position. a small example is shown below..
$ cat beep.txt
It is first documented as being played in southern England.
In the 16th century.
By the end of the 18th century,
Cricket is a... (5 Replies)
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Hi Folks
I need a one liner to parse through a log and if the string is found print the line above, the line with the string and the line below.
example:
The ball is green and blue
Billy through the ball higer.
Jane got hurt with the ball.
So if I search for Billy I would need the 3... (1 Reply)
Hi all,
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
<date1>|<data1>|<url1>|<result1>
<date2>|<data2>|<url2>|<result2>
<date3>|<data3>|<url3>|<result3>
<date4>|<data4>|<url4>|<result4>
What I... (3 Replies)
I want to retrieve Status from below example. Columns numbers will be dynamic but Status will always be 2nd last-
JobName StartTime EndTime Status ExitCode
autorep -j $jobName | grep '^FR' | awk -F' ' '{print $2}' The above code gives me the 2nd column from start of the line. (7 Replies)
I pass a number to my script. Passing "1" below.
./getfile.sh 1
echo "User entered: $1"
ls -ltr *.conf | sed -n '$p'
I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output.
Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
LEARN ABOUT NETBSD
insertln
CURSES_INSERTLN(3) BSD Library Functions Manual CURSES_INSERTLN(3)NAME
curses_insertln, insertln, winsertln -- curses insert single line routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
int
insertln(void);
int
winsertln(WINDOW *win);
DESCRIPTION
These functions insert a single line on stdscr or on the specified window.
The insertln() function inserts a blank line before the current line on stdscr. The current line and all lines below are moved down one line
away from the cursor and the bottom line of the window is lost.
The winsertln() function is the same as the insertln() function, excepting that the line is inserted on the window win.
If a scrolling region has been set with the setscrreg() or wsetscrreg() functions and the current cursor position is inside the scrolling
region, then only the lines from the current line to the bottom of the scrolling region are moved down and the bottom line of the scrolling
region lost.
The functions insertln() and winsertln(win) are equivalent to insdelln(1) and winsdelln(win, 1), respectively.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO curses_deleteln(3), curses_insdelln(3), curses_scroll(3)STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.
BSD February 5, 2006 BSD