diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py --- a/libcxx/utils/ssh.py +++ b/libcxx/utils/ssh.py @@ -16,6 +16,7 @@ import argparse import os +import pipes import posixpath import shlex import subprocess @@ -107,7 +108,7 @@ commandLine = (pathOnRemote(x) if isTestExe(x) else x for x in commandLine) remoteCommands.append('cd {}'.format(tmp)) if args.env: - remoteCommands.append('export {}'.format(' '.join(args.env))) + remoteCommands.append('export {}'.format(pipes.quote(' '.join(args.env)))) remoteCommands.append(subprocess.list2cmdline(commandLine)) # Finally, SSH to the remote host and execute all the commands.