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"
1.4m articles
1.4m replys
5 comments
57.0k users