sort-by-length
raw| 1 | #!/bin/bash -norc |
| 2 | |
| 3 | # Public domain notice for all NCBI EDirect scripts is located at: |
| 4 | # https://www.ncbi.nlm.nih.gov/books/NBK179288/#chapter6.Public_Domain_Notice |
| 5 | |
| 6 | binary=$( command -v perl ) |
| 7 | if [ ! -x "$binary" ] |
| 8 | then |
| 9 | echo "ERROR: required perl helper is not present" >&2 |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | perl -e 'print sort { length($a) <=> length($b) } <>' |