File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# # shell-like command parsing ##
4
4
5
+ const shell_special = " #{}()[]<>|&*?~;"
6
+
5
7
function shell_parse (str:: AbstractString , interpolate:: Bool = true )
6
8
s = lstrip (str)
7
9
# strips the end but respects the space when the string ends with "\\ "
@@ -92,6 +94,8 @@ function shell_parse(str::AbstractString, interpolate::Bool=true)
92
94
update_arg (s[i: j- 1 ]); i = k
93
95
c, k = next (s,k)
94
96
end
97
+ elseif ! in_single_quotes && ! in_double_quotes && c in shell_special
98
+ depwarn (" special characters \" $shell_special \" should now be quoted in commands" , :shell_parse )
95
99
end
96
100
j = k
97
101
end
@@ -129,7 +133,7 @@ function print_shell_word(io::IO, word::AbstractString)
129
133
has_single = false
130
134
has_special = false
131
135
for c in word
132
- if isspace (c) || c== ' \\ ' || c== ' \' ' || c== ' "' || c== ' $'
136
+ if isspace (c) || c== ' \\ ' || c== ' \' ' || c== ' "' || c== ' $' || c in shell_special
133
137
has_special = true
134
138
if c == ' \' '
135
139
has_single = true
You can’t perform that action at this time.
0 commit comments