How can I retain numbers for sorting them later?
问题 I have a problem that sounds like this: Write a shell script that for each file from the command line will output the number of words that are longer than the number k read from keyboard. The output must be ordered by the number of words. How can i retain the number of characters of each file,for sorting them? I tried something like that : #!/bin/bash if [ #@ -ne 1 ] then exit 1 fi array[$@]='' echo -n "Give the number>" read k for f in $@; do n=`$f | wc -c` if [ $n -gt $k ]; then i++ array[i