function foo() { A=$@... echo $A } foo bla \"hello ppl\"
I would like the output to be: \"bla\" \"hello ppl\"
What do I need to do in
@msw has the right idea (up in the comments on the question). However, another idea to print arguments with quotes: use the implicit iteration of printf:
printf
foo() { printf '"%s" ' "$@"; echo ""; } foo bla "hello ppl" # => "bla" "hello ppl"