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
Use parameter substitution to add " as prefix and suffix:
function foo() { A=("${@/#/\"}") A=("${A[@]/%/\"}") echo -e "${A[@]}" } foo bla "hello ppl" kkk 'ss ss'
Output
"bla" "hello ppl" "kkk" "ss ss"