How to sort standard input without first line < Header > shamrock - Shell Programming and Scripting - Unix Linux Forums

  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 03-26-2008
shamrock shamrock is offline Forum Advisor  
Registered User
 
Join Date: Oct 2007
Last Activity: 16 September 2014, 4:52 PM EDT
Location: USA
Posts: 1,459
Thanks: 19
Thanked 139 Times in 131 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"}'