#!/bin/bash # Quote arguments in a nicer way than can be accomplished with ${param@Q} alone, # as currently happens in edo(). quote_args_53() { { local str -; set +x; } 2>/dev/null str=${ local BASH_XTRACEFD PS4 fd - exec {fd}>&1 set -x { BASH_XTRACEFD=$fd; } 2>/dev/null : "$@" } printf '%s\n' "${str:2}" } quote_args_53 'foo bar' $'bar\n\nba\ez' arse 'bis*cuits*'