#!/bin/bash
while read x; do
## print the number of words and then the line it self
## add it to a temp file
echo "$(echo $x | wc -w) $x" >> temp.txt
done < $1 ## expecting an argument passed
# sort in numerical order, and then print from the second field forward
sort -n temp.txt | cut -f2- -d" "