-1

I have the following functions

func() { shift 2; func2 $@; }
func2() { echo $1; echo $2; }
func 1 2 "3 3" "4 4"

I exepect that func2 will dispaly "3 3" and "4 4". but the func2 see the both 3 as separate args and not as a one arg.

What I m missing here? how I can make func2 to see the "3 3" as arg1 and "4 4" as arg2 ?

MOHAMED
  • 41,599
  • 58
  • 163
  • 268

1 Answers1

3

You need to use double quotes around "$@" in order for it to work.

tripleee
  • 175,061
  • 34
  • 275
  • 318