Попробуйте следующее:
#!/bin/bash
# Call this script with the extensions you want to move.
# E.g., ./script mp4 avi flv
From="/home/katy/doc"
To="/home/katy/mo" #directory where the media files will go
WA="/home/katy/do" # directory where the other files will go
if [[ ! -d "$To" ]]; then
mkdir -p "$To"
fi
cd "$From"
for i in "$@"; do # You could also hard code this: for i in mp3 mp4 avi; do
find . -type f -name "*.${i}" -exec mv "{}" "$To" \;
done
{и} являются специальными символами. Я думаю, что добавление кучу цитат в ваш скрипт поможет сделать его более понятным и работать лучше.