Shell how to let a array as other shell args? -


i have 2 shell script a.sh,b.sh .

--------a.sh---------  array=(1.1 1.2 1.3)  ./b.sh $array  --------end a.sh---------   --------b.sh---------  packageversionarr=$1  in ${packageversionarr[@]};      echo $i  done  --------end b.sh---------  console print: 1.1 

where 1.2 , 1.3?

$array first element, need ${array[*]}. see arrays in guide.

bash -x $ array=(1.1 1.2 1.3) + array=(1.1 1.2 1.3) $ ./b.sh $array + ./b.sh 1.1 ... $ ./b.sh ${array[*]} + ./b.sh 1.1 1.2 1.3 ... 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -