# quote all shell parameters
arg_quote() {
  for ARG; do
    SQESC=$(printf '%s\n' "${ARG}" | sed -e "s/'/'\\\\''/g")
    printf '%s ' "'${SQESC}'"
  done
}

arg_dblquote() {
  for ARG; do
    SQESC=$(printf '%s\n' "${ARG}" | sed -e 's/"/\\"/g')
    # shellcheck disable=SC2086
    printf '%s ' '"'${SQESC}'"'
  done
}

# quote all shell parameters.
# unsafe: does not escape inner quotes
arg_quote_unsafe() {
  printf "'%s' " "$@"
}
arg_dblquote_unsafe() {
  printf '"%s" ' "$@"
}
