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
Krrishv Krrishv is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 24 December 2015, 4:32 PM EST
Location: CA,United States
Posts: 204
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
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
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
Krrishv Krrishv is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 24 December 2015, 4:32 PM EST
Location: CA,United States
Posts: 204
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 11:39 AM
Removing Characters From finger Output jamba1 Shell Programming and Scripting 2 05-15-2010 03:06 AM
Removing Null data in output liketheshell Shell Programming and Scripting 2 08-13-2007 04:59 PM
Removing Garbage output skyineyes Shell Programming and Scripting 4 07-04-2007 05:03 PM
removing line and duplicate line ocelot UNIX for Dummies Questions & Answers 11 01-30-2007 11:44 AM



All times are GMT -4. The time now is 06:36 AM.