Sponsored Content
Top Forums Shell Programming and Scripting Get the bottom line of a file to the top of the file Post 302368018 by Shellslave on Wednesday 4th of November 2009 03:34:37 AM
Old 11-04-2009
@pogdorica

yes you are right . The code you gave is working like miracle and is as per the requirement. Thanks for the effort.Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to search for a pattern from bottom to top.

Hi, I have a file, which is having a pattern "SEARCH" somewhere towards end of the file, if i am giving " grep -i "SEARCH" $File" , it is taking too much time as file is very big. So i want to search for the pattern from the back side of the file, how can we search for a pattern in bottom... (5 Replies)
Discussion started by: Prat007
5 Replies

2. AIX

want to remove some line from top of file.

Hi All, I have AIX 5.3 server. I have one big file. in that i want to remove 5000 line from top. is there any command for this? Thanks, Vishal (6 Replies)
Discussion started by: vishalpatel03
6 Replies

3. Shell Programming and Scripting

best way to insert a line at the top of a file?

say I want to insert "this is a test" as the first line into file A, besides echo "this is a test" > /tmp/tmpfile cat /tmp/tmpfile fileA >> /tmp/result, is there any simple way I can do it? thanks (7 Replies)
Discussion started by: fedora
7 Replies

4. UNIX for Dummies Questions & Answers

add a new line on top of a file

infile a b c A E F 1 2 3 outfile new line a b c A E F 1 2 3 I tried: sed '1i\ new line' infile > outfilecat outfile new linea b c A E F 1 2 3 I don't want the new line be added to the existing first line. Thanks Joseph (7 Replies)
Discussion started by: jdhahbi
7 Replies

5. Shell Programming and Scripting

Search for string and print top and bottom line

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)
Discussion started by: bombcan
1 Replies

6. Ubuntu

Title bar top and bottom

Hello forum, Seems that only I have alot of questions regarding Ubuntu :D In Ubuntu 12.04 LTS the gnome I have been using gdm and lightdm. In lightdm the top and side bars are aka "unity" and can be removed using apt-get remove unity I need to do the same for menu bars gdm. I do not... (0 Replies)
Discussion started by: br1an
0 Replies

7. Shell Programming and Scripting

How to print from bottom to top?

Hi, i have a file which contains PID and wanted to execute kill command. but the thing is, when killing PID's needs to kill PID from bottom to top. Please help INPUT 21414 sh -c extract.ksh ASA 21416 /bin/ksh extract.ksh ASA 21428 /usr/bin/perl -w /var/tmp/tempperl.21416 ASA... (4 Replies)
Discussion started by: reignangel2003
4 Replies

8. Shell Programming and Scripting

Remove top and bottom for each column

Dear All I was wondering if someone could help me in resolving an issue. I have a file like this: column1 column2 2 4 3 5 8 9 0 12 0 0 0 0 9 0 87 0 1 0 1 0 1 0 4 0 (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

9. Shell Programming and Scripting

Removing top few and bottom few rows in a file

Hi, I have a requirement where I need to delete given number of top and bottom rows in a flat file which has new line as its delimiter. For ex: if top_rows=2 & bottom_rows=1 Then in a given file which looks like: New York DC LA London Tokyo Prague Paris Bombay Sydney... (7 Replies)
Discussion started by: calredd
7 Replies
curs_border(3X) 														   curs_border(3X)

NAME
border, wborder, box, hline, whline, vline, wvline, mvhline, mvwhline, mvvline, mvwvline - create curses borders, horizontal and vertical lines SYNOPSIS
#include <curses.h> int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); int box(WINDOW *win, chtype verch, chtype horch); int hline(chtype ch, int n); int whline(WINDOW *win, chtype ch, int n); int vline(chtype ch, int n); int wvline(WINDOW *win, chtype ch, int n); mvhline(int y, int x, chtype ch, int n); mvwhline(WINDOW *, int y, int x, chtype ch, int n); int mvvline(int y, int x, chtype ch, int n); int mvwvline(WINDOW *, int y, int x, chtype ch, int n); DESCRIPTION
The border, wborder and box routines draw a box around the edges of a window. Other than the window, each argument is a character with attributes: ls - left side, rs - right side, ts - top side, bs - bottom side, tl - top left-hand corner, tr - top right-hand corner, bl - bottom left-hand corner, and br - bottom right-hand corner. If any of these arguments is zero, then the corresponding default values (defined in curses.h) are used instead: ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER. box(win, verch, horch) is a shorthand for the following call: wborder(win, verch, verch, horch, horch, 0, 0, 0, 0). The hline and whline functions draw a horizontal (left to right) line using ch starting at the current cursor position in the window. The current cursor position is not changed. The line is at most n characters long, or as many as fit into the window. The vline and wvline functions draw a vertical (top to bottom) line using ch starting at the current cursor position in the window. The current cursor position is not changed. The line is at most n characters long, or as many as fit into the window. RETURN VALUE
All routines return the integer OK. The SVr4.0 manual says "or a non-negative integer if immedok is set", but this appears to be an error. NOTES
The borders generated by these functions are inside borders (this is also true of SVr4 curses, though the fact is not documented). Note that border and box may be macros. PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. The standard specifies that they return ERR on failure, but specifies no error conditions. SEE ALSO
curses(3X), curs_outopts(3X). curs_border(3X)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy