LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-17-2009, 06:04 AM   #1
rahulruns
LQ Newbie
 
Registered: Feb 2008
Posts: 21

Rep: Reputation: 0
Sort an array


Need to sort an array which has elements which are numeric. sort command work good for string.
 
Old 11-17-2009, 06:07 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Please read the sort man page, specifically the flags which will sort based on numeric values.
 
Old 11-17-2009, 06:49 AM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 241Reputation: 241Reputation: 241
which language?
 
Old 11-17-2009, 06:50 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by ghostdog74 View Post
which language?
Good catch.

I was assuming bash, but OP, please clarify.
 
  


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
php sort help - sort numerical descending then by alphabetical? RavenLX Programming 3 03-11-2009 09:35 AM
Sort an array in python J_Szucs Programming 3 06-15-2008 05:33 PM
selection sort compiles but does not sort the array as desired ganesha Programming 2 04-20-2008 08:44 AM
Is there a line limit with the sort utility? Trying to sort 130 million lines of text gruffy Linux - General 4 08-10-2006 09:40 PM
php array sort inconsistent results rblampain Programming 2 04-03-2006 01:34 AM


All times are GMT -5. The time now is 02:14 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration