The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-10-2008
charandevu charandevu is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 29
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
  #2 (permalink)  
Old 04-27-2008
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0