Revert "shell: remove useless copying of input string"

This reverts commit 33239487bf8f7f85a7d27ad5bd912079c503b4cd.
fix2