Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Removing first line from output

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-09-2007   -   Original Discussion by Krrishv
Krrishv Krrishv is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 4 October 2017, 11:30 PM EDT
Location: CA,United States
Posts: 205
Thanks: 1
Thanked 0 Times in 0 Posts
Removing first line from output

my script gives 10 outputs continuously..In each output i have to remove the first line in the output.How to do that.

for eg : below is my output
0.00
1.00
5.00
0.00
7.00

i have to remove the first line of this output ie;0.00
Sponsored Links
    #2  
Old Unix and Linux 01-09-2007   -   Original Discussion by Krrishv
anbu23's Unix or Linux Image
anbu23 anbu23 is offline Forum Advisor  
Advisor
 
Join Date: Mar 2006
Last Activity: 8 February 2017, 4:04 AM EST
Location: Bangalore,India
Posts: 2,153
Thanks: 21
Thanked 159 Times in 150 Posts

Code:
your_cmd | tail -2

or


Code:
your_cmd | sed "1 d"

Sponsored Links
    #3  
Old Unix and Linux 01-09-2007   -   Original Discussion by Krrishv
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 
Join Date: Mar 2005
Last Activity: 10 January 2017, 8:10 AM EST
Location: classification algos
Posts: 3,215
Thanks: 19
Thanked 31 Times in 28 Posts

Code:
output | awk '{ if ( NR > 1  ) { print } }'

    #4  
Old Unix and Linux 01-09-2007   -   Original Discussion by Krrishv
Krrishv Krrishv is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 4 October 2017, 11:30 PM EDT
Location: CA,United States
Posts: 205
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks both the commands work great
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Removing a line IF the next line contains string eh3civic Shell Programming and Scripting 2 09-22-2011 12:39 PM
Removing Characters From finger Output jamba1 Shell Programming and Scripting 2 05-15-2010 04:06 AM
Removing Null data in output liketheshell Shell Programming and Scripting 2 08-13-2007 05:59 PM
Removing Garbage output skyineyes Shell Programming and Scripting 4 07-04-2007 06:03 PM
removing line and duplicate line ocelot UNIX for Dummies Questions & Answers 11 01-30-2007 12:44 PM



All times are GMT -4. The time now is 12:26 PM.