Splitting the command string before substitution

Simply splitting after substitution breaks the command when the
filename contains spaces.