I'm trying to pass multiple argument to a function, but one of them is consist of two words and I want shell function to deal with it as one arg:args=($@)function(){ echo ${args[0]} echo ${args[1]} echo ${args[2]}}when I call this command sh shell hi hello guys byeI get thishihelloguysBut what I really want is:hi hello guysbye
How to pass argument with spaces to a shell script function?
shell script;arguments
You should just quote the second argument.myfunc(){        echo $1        echo $2        echo $3}myfunc hi hello guys bye