0

I'm trying to execute a korn shell script using an array, but I would like to see if this is possible, I don't want to do is the follow example:

Script="/home/Myscript.sh"
. ${Script} "Value1" "Value2" "Value3"

Would be better if I can do something like:

Array[0]="Value1"
Array[1]="Value2"
Array[2]="Value3"
. ${Script} "${Array}

Is there a way to do this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Javier Salas
  • 1,064
  • 5
  • 15
  • 38

1 Answers1

1

It's possible!

You just have to put something like:

. ${Script} "${array[@]}"

If your array have more than 1 value, all of those will be received. :)

Javier Salas
  • 1,064
  • 5
  • 15
  • 38