![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comparing 2 files - kindly assist expert | chew | Shell Programming and Scripting | 15 | 03-24-2008 04:59 AM |
| sort | mirusnet | Shell Programming and Scripting | 2 | 01-27-2008 02:27 PM |
| need help in sort | ali560045 | Shell Programming and Scripting | 2 | 12-04-2007 07:38 AM |
| Can someone kindly help with appending problem!!! | cyberray | Shell Programming and Scripting | 10 | 10-24-2007 06:15 AM |
| FOR loop problem: Kindly Help | okdev | Shell Programming and Scripting | 6 | 10-06-2007 09:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Kindly help : sort
Iam new to Unix ....analyzing the code
Can any one pls explain what does it mean by below code Code:
sort +0 -1 +1 -2 +2 -3n +3 -4n +4 -5n file.txt -o awaiting for reply ..... Last edited by Yogesh Sawant; 04-10-2008 at 03:09 AM.. Reason: added code tags |
|
||||
|
Hi there,
it is an obsolete method of sorting according to the specific feilds and characters in them; you would see -k key as a replacement of this method. +m refers to a feild_start and -m is feild_end where m=0,1,2,3,.....to some no.of feilds available in the file to be sorted. and the 'n' used with (-3n, -4n and -5n) specifies to make a numeric sort on that particular feild. so, your code does sort on first feild, second feild, numeric sort on third feild, numeric sort on fourth feild and numeric sort on fifth feild. and the -o option is to specify a file to store this soretd o/p. by default space would be the feild seperator; optionally you can use -t with some character as a feild seperator. -ilan |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|