Hacker News new | ask | show | jobs
by jwilk 2465 days ago
In Bash ≥ 4.4, you can also use parameter transformations:

    function quote() {
      echo "${@@Q}"
    }
(In both cases, the generated output is understood bash, but not necessarily by other POSIX-compliant shells.)