how to put all command arguments in one variable
问题 I want to execute a shell script that require 3 arguments. The argument number 2 contains a string with space I want to put all arguments in one variable like this: Linux:~# kk="\"111\" \"222 222\" \"333\"" Linux:~# echo $kk "111" "222 222" "333" Now If I call a function: func() { echo ---$1--- echo ---$2--- echo ---$3--- } with the $kk variable in this way func $kk Then it will return Linux:~# func $kk ---"111"--- ---"222--- ---222"--- And I was expecting to get this result ---111--- ---222