misc: quote args in echoed command line
Currently if there are shell special characters in a command-line argument, you can't copy and paste the echoed command line onto a shell prompt because the characters aren't quoted properly. This patch fixes that problem.
This commit is contained in:
parent
bcea57afc3
commit
5302305255
1 changed files with 3 additions and 3 deletions
|
@ -293,9 +293,9 @@ def main(*args):
|
||||||
datetime.datetime.now().strftime("%b %e %Y %X")
|
datetime.datetime.now().strftime("%b %e %Y %X")
|
||||||
print "gem5 executing on %s" % socket.gethostname()
|
print "gem5 executing on %s" % socket.gethostname()
|
||||||
|
|
||||||
print "command line:",
|
# in Python 3 pipes.quote() is moved to shlex.quote()
|
||||||
for argv in sys.argv:
|
import pipes
|
||||||
print argv,
|
print "command line:", " ".join(map(pipes.quote, sys.argv))
|
||||||
print
|
print
|
||||||
|
|
||||||
# check to make sure we can find the listed script
|
# check to make sure we can find the listed script
|
||||||
|
|
Loading…
Reference in a new issue