Your point definitely make sense. However in practice this code haven't worked for me until I escaped the input for `cat` command.