Move files to directories based on first part of filename?
Actually found a different way of doing it, just thought I'd post this for others to see/use if they would like.
#!/bin/bashdir="/books"if [[ `ls | grep -c pdf` == 0 ]]then echo "NO PDF FILES"else for src in *.pdf do author=${src%%-*} authorlength=$((${#author}-1)) letter=${author:0:1} author=${author:0:$authorlength} mkdir -p "$dir/$letter/$author" mv -u "$src" "$dir/$letter/$author" donefi