Skip to content

Commit

Permalink
Merge pull request avocado-framework#5973 from changxuqing/master
Browse files Browse the repository at this point in the history
Dictionary storage
  • Loading branch information
richtja authored Jul 9, 2024
2 parents b796ae7 + f1abc00 commit 9e81398
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions avocado/utils/astring.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ def shell_escape(command):
See also: http://www.tldp.org/LDP/abs/html/escapingsection.html
"""
command = command.replace("\\", "\\\\")
command = command.replace("$", r"\$")
command = command.replace('"', r"\"")
command = command.replace("`", r"\`")
escape_chars = {"\\": "\\\\", "$": r"\$", '"': r"\"", "`": r"\`"}
for char, escaped_char in escape_chars.items():
command = command.replace(char, escaped_char)
return command


Expand Down

0 comments on commit 9e81398

Please sign in to comment.