script icon indicating copy to clipboard operation
script copied to clipboard

Implement Execv function (equivalent to Exec but with args passed as …

Open paulc opened this issue 2 years ago • 1 comments

Hello,

Really enjoying using script however there have been a couple of use cases where I have wanted to avoid interpolating the Exec args into a single cmdLIne (and worrying about quoting - which can be complex if dealing with arbitrary input) and have therefore added an Execv(cmd string, args []string) method which passes the cmd and args separately as []string (which is what gets passed to exec.Command anyway so saves re-parsing the command line).

Think this would be a useful addition (and be safer for scripts which make need to Exec commands where some of the parameters are untrusted)

paulc avatar Aug 25 '23 20:08 paulc

I would very much appreciate having this slice-based Exec! Is this PR being considered?

jesselang avatar Feb 21 '25 18:02 jesselang