@msw有正确的想法(在问题的评论中).但是,使用引号打印参数的另一个想法是:使用printf的隐式迭代:
foo() { printf '"%s" ' "$@"; echo ""; } foo bla "hello ppl" # => "bla" "hello ppl"
foo() { printf '"%s" ' "$@"; echo ""; } foo bla "hello ppl" # => "bla" "hello ppl"