LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2004, 11:04 AM   #1
saravanan1979
Member
 
Registered: Jan 2002
Posts: 163

Rep: Reputation: 30
Sort Command


Hi ,
I have a question about sort command.I want to sort a file by 4-6th field.
sort +4 -6 <filename>
But this 4th field is optional and may not be present always.In such a scenario sort ran perfectly well without any error.I am unable to understand the same .Can any Linuz gurus explain the reason for this.

Regards
Saravanan
 
Old 10-03-2004, 11:36 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Sort works with the position of a field in a line.

Sort will take the 4th field anyway, but will contain the data of what you expect to be in the 5th field.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line to sort files satimis Programming 6 06-28-2005 02:50 AM
Activating case sensitivity in `sort' command? wirawan0 Linux - General 4 06-26-2004 10:20 AM
sort pantera Programming 5 05-26-2004 07:36 PM
The SORT command Rezon Programming 2 10-30-2003 04:14 PM
Using the Sort command in vi timnphx Programming 2 04-06-2001 11:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration