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 instead of the ellipsis?
@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"
2.1m questions
2.1m answers
60 comments
57.0k users