I want to execute a shell script that requires 3 arguments.
Argument number 2 contains a space with a space
I want to put all the arguments in one variable as follows:
Linux:~# kk="\"111\" \"222 222\" \"333\"" Linux:~# echo $kk "111" "222 222" "333"
Now, if I call the function:
func() { echo ---$1--- echo ---$2--- echo ---$3--- }
with the variable $ kk this way
func $kk
Then he will return
Linux:~# func $kk ---"111"--- ---"222--- ---222"---
And I expected to get this result
How to solve this problem without using eval ?
I know that eval solves this problem, but I do not want to use it (since it takes a lot of time to make such a call).
linux shell ash
Mohammed
source share