Added quotes to filenames in shell commands

Now the program should succeed when there are spaces in
filenames or in the prefix.