How to compare two number
How to compare two number in Ksh.For example
0001 0002 0001 0003 0002 |
Sort the number
Kindly any one tell me how to sort the number in Kshell
0001 0002 0003 0001 0002 |
Hi nauman9004 and welcome to LQ,
Bumping your own thread after just an hour is not done (although I do see now that you added a second question), it also has another side-effect: It takes you of the zero reply list (all post with no replies are cycled to give them more exposure). About your first request: Which 2 numbers need to be compared and how are these numbers entered (by hand, in a file)? About your second request: Have a look at the sort command. Hope this helps. |
Sort the number
hello druuna
four numbers are there 0001 , 0002 ,0001,0003 i want to compare these number and sort these numbers these numbers are get from file |
Hi,
Quote:
Quote:
Hope this helps. |
If the numbers are on separate lines you can use
Code:
sort -n filename Code:
cat filename | tr ',' '\n' | sort -n |
Quote:
|
well you've already been told about sort. What do you mean by comparing? just comparing two numbers doesn't *do* anything...
|
thanks whizje for sorting it is okay
|
And I'll pipe up as the third one to ask: what are you comparing them to?
In which way do you need to compare them? |
All times are GMT -5. The time now is 04:18 PM. |