yeah nhs is right . I even checked your program by removing
Then
Quote:
[SaTaN@mirage linux_org]$ sh bash.sh
input 10 scores : 1 2 3 4 5 6 7 8 9 10 11
Ordered Scores : 11 10 9 8 7 6 5 4 3 2 1
66
|
So I suppose you should remove those equal to signs in
Code:
for ((i=0; i<=10; i++))
This is if you want to accept only 10 numbers
And your code doesn't work for the next time because you are using >> which means append and so the 11 numbers which are
entered now will get appended to the previous 11 numbers and so on.
Don't use temp1 , if you really want to use it add a statement
rm -f temp1
at the end of the your code.
And your order is not ascending it is descending
Welcome to LQ