highest.sh 227 B

1234567891011
  1. #!/usr/bin/bash
  2. # sorts lines in a text file in ascending order
  3. # usage is highest filename [howmany]
  4. filename=$1
  5. filename=${filename:?" You did not enter a file name."}
  6. howmany=${2:-10}
  7. sort -nr $filename | head -$howmany