lotabout / rargs

xargs + awk with pattern matching support. `ls *.bak | rargs -p '(.*)\.bak' mv {0} {1}`
MIT License
484 stars 21 forks source link

Escaping curly braces in command #25

Open qbx2 opened 1 week ago

qbx2 commented 1 week ago

Hello. First of all, thank you for writing this super useful utility.

Today, I wanted to run curl commands using rargs, with -w '%{http_code}' to change curl's output behavior. However, I just found that rargs is replacing the format string to '%'. I tried using '{{' or '{' instead of '{' but it did not work. Is this possible to escape curly braces in this case?

qbx2 commented 1 week ago

My workaround:

$ export FORMAT='%{http_code}\n'
$ pbpaste | rargs bash -c 'curl -w "$FORMAT" ...'