Skip to content

Commit

Permalink
Escape all shell special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
thaliaarchi committed Nov 25, 2024
1 parent d934fb6 commit 011d06d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jqjq.jq
Original file line number Diff line number Diff line change
Expand Up @@ -2735,9 +2735,9 @@ def parse_options:
);

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

0 comments on commit 011d06d

Please sign in to comment.