Unix/Linux Go Back    



How to sort standard input without first line < Header >

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member shamrock Regarding:
How to sort standard input without first line < Header >.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 03-26-2008
shamrock shamrock is offline Forum Advisor  
Registered User
 
Join Date: Oct 2007
Last Activity: 15 April 2015, 10:26 AM EDT
Location: USA
Posts: 1,556
Thanks: 25
Thanked 150 Times in 142 Posts
If the input file has a single column then you do not need the sort by key 1

Code:
awk 'NR == 1; NR > 1 {print $0 | "sort -nr"}'