diff --git a/lib/ansible/plugins/shell/sh.py b/lib/ansible/plugins/shell/sh.py index cd765e413cf..54d2b57c8fe 100644 --- a/lib/ansible/plugins/shell/sh.py +++ b/lib/ansible/plugins/shell/sh.py @@ -67,8 +67,8 @@ class ShellModule(object): basetmp = self.join_path(C.DEFAULT_REMOTE_TMP, basefile) if system and (basetmp.startswith('$HOME') or basetmp.startswith('~/')): basetmp = self.join_path('/tmp', basefile) - cmd = 'mkdir -p "$(echo %s)"' % basetmp - cmd += ' && echo "$(echo %s)"' % basetmp + cmd = 'mkdir -p "`echo %s`"' % basetmp + cmd += ' && echo "`echo %s`"' % basetmp # change the umask in a subshell to achieve the desired mode # also for directories created with `mkdir -p`