Try it again, using just the default actions: $ ./despacer.sh "foo bar.txt" mv: target 'bar.txt' is not a directory You've introduced a new feature, but you've also introduced a bug that causes it to fail.