I\'m looking for the best way to take a simple input:
echo -n \"Enter a string here: \" read -e STRING
and clean it up by removing non-alph
After a bit of looking around it seems tr is indeed the simplest way:
tr
export CLEANSTRING="`echo -n "${STRING}" | tr -cd '[:alnum:] [:space:]' | tr '[:space:]' '-' | tr '[:upper:]' '[:lower:]'`"
Occam's razor, I suppose.