Skip to content

Commit e35c266

Browse files
authored
Merge pull request #23 from thaliaarchi/sh-escape
Escape all shell special characters
2 parents d934fb6 + 011d06d commit e35c266

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jqjq.jq

+2-2
Original file line numberDiff line numberDiff line change
@@ -2735,9 +2735,9 @@ def parse_options:
27352735
);
27362736

27372737
def invoke_client_jqjq:
2738-
# instead of @sh to not always quote
2738+
# instead of @sh to not always quote (as per quoting rules of ${var@Q})
27392739
def sh_escape:
2740-
if . == "" or test("['\" $\n\\\\()]") then
2740+
if . == "" or test("[^[A-Za-z0-9%+\\-./:=@_]]") then
27412741
"'" + gsub("'"; "'\\''") + "'"
27422742
end;
27432743
( . as $args

0 commit comments

Comments
 (0)