dotfiles/home/default/scripts/sort-by-length

5 lines
109 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cat input.txt | awk '{ print length, $0 }' | sort -n | cut -d" " -f2-