So if you want to know what the options to sort are, read the man page on sort. If you want to know the internals of sort, you can probably find GNU source or BSD source somewhere. If you want to know what any of this has to do with C, well, so do I.

Edit: And a bonus hint: that ':' you have is probably a bad copy of somebody's hand-written IBM-style broken pipe character for '|'. (My keyboard, at least, shows a broken pipe on the key itself, so that's probably what you're looking at.)

Hi everyone

Please stop showing off ur whacky IQ.Obviously i checked the man pages on sort.If u guys cant be helpful,keep your mouth shut and be humble instead of pinpointing others' small mistakes.U ll do better than this.U egoistic punks.This forum is supposed to help people learn and not point out stupid mistakes.Fools

Please stop showing off ur whacky IQ.Obviously i checked the man pages on sort.If u guys cant be helpful,keep your mouth shut and be humble instead of pinpointing others' small mistakes.U ll do better than this.U egoistic punks.This forum is supposed to help people learn and not point out stupid mistakes.Fools

U guys cant help and try to show off ur creativity by elaborating on metaphors between broken pipes and IBM style crap.nuts

I'll tell you what, if you can settle down there, realize that your first post didn't make sense whatsoever, and write two or three legible sentences followed by a meaningful question, I will try to help you.

gurvinder, you may have checked the relevant documentation, but your posts show nothing of the sort. Present your question clearly, state what you are having problem with and what you have tried to solve/understand the problem so that people can see that you have put in effort.

Your response warrants an official warning according to the forum guidelines, but I shall hold it off since you are new and perhaps did not understand the responses you got.

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.

So apparently your question is about the options after all. (Note that in two whole posts you managed to NOT MENTION WHAT YOUR BLEEDING QUESTION WAS IN ANY WAY WHATSOEVER. Note that this is not a "small mistake" but the largest mistake you can actually make on a help forum. And it turns out that prodding you with questions was in fact helpful, since it made you actually TELL US WHAT YOUR QUESTION IS. Thank you for your consideration of this matter.)

But if you had read the man page, you would have seen this:

Originally Posted by sort man page

`-n'
Sort numerically: the number begins each line; specifically, it
consists of optional whitespace, an optional `-' sign, and zero or
more digits possibly separated by thousands separators, optionally
followed by a radix character and zero or more digits. The
`LC_NUMERIC' locale specifies the radix character and thousands
separator.

`sort -n' uses what might be considered an unconventional method
to compare strings representing floating point numbers. Rather
than first converting each string to the C `double' type and then
comparing those values, sort aligns the radix characters in the two
strings and compares the strings a character at a time. One
benefit of using this approach is its speed. In practice this is
much more efficient than performing the two corresponding
string-to-double (or even string-to-integer) conversions and then
comparing doubles. In addition, there is no corresponding loss of
precision. Converting each string to `double' before comparison
would limit precision to about 16 digits on most systems.

Neither a leading `+' nor exponential notation is recognized. To
compare such strings numerically, use the `-g' option.

`-t SEPARATOR'
Use character SEPARATOR as the field separator when finding the
sort keys in each line. By default, fields are separated by the
empty string between a non-whitespace character and a whitespace
character. That is, given the input line ` foo bar', `sort'
breaks it into fields ` foo' and ` bar'. The field separator is
not considered to be part of either the field preceding or the
field following.

`+POS1[-POS2]'
The obsolete, traditional option for specifying a sort field.
The field consists of the line between POS1 and up to but _not
including_ POS2 (or the end of the line if POS2 is omitted).
Fields and character positions are numbered starting with 0.
See below.

Obviously I didn't copy the options you didn't use. (I really shouldn't have bothered doing this, but I'm a giver.)

Edit: And obviously the shouting isn't really called for, since you all seem to have had the good conversation while I was cutting and pasting. I apologize.

So apparently your question is about the options after all. (Note that in two whole posts you managed to NOT MENTION WHAT YOUR BLEEDING QUESTION WAS IN ANY WAY WHATSOEVER. Note that this is not a "small mistake" but the largest mistake you can actually make on a help forum. And it turns out that prodding you with questions was in fact helpful, since it made you actually TELL US WHAT YOUR QUESTION IS. Thank you for your consideration of this matter.)

But if you had read the man page, you would have seen this:

Obviously I didn't copy the options you didn't use. (I really shouldn't have bothered doing this, but I'm a giver.)

Edit: And obviously the shouting isn't really called for, since you all seem to have had the good conversation while I was cutting and pasting. I apologize.

Thanks TABSTOP.Can someone or u please clarify the following
In this case
--------------------------------------------------------------------------------

`+POS1[-POS2]'
The obsolete, traditional option for specifying a sort field.
The field consists of the line between POS1 and up to but _not
including_ POS2 (or the end of the line if POS2 is omitted).
Fields and character positions are numbered starting with 0.
See below.

Then if u see the sort cmd,the sorting will take place between +1 and upto but not including - 2.Now this is confusing what field will refer to 000 or 2008-07-17.
The field 000 is Field 1 and 2008-07-17 is Field 2.Sorting will take place according to which field and what algorithm ,numerical order or what?

And I noticed you fixed the | for :. So we start by sorting field 0 (up to but not including 1, so just field 0), numerically (that's what -n says, right there in what I copied), then field 1, then field 2.