Removing trailing slashes as explained here: http://superuser.com/questions/564716/bash-completion-for-filename-patterns-or-directories