Simplified everything using shell-command.