variable returns two values, how to store them in different variables?

advertisements

My variable is returning two values and i have to pass these values at the same time in a shell script.

echo $var

output :

23514
abcd

Now i have to run a shell script with 23514 and 'abcd' as arguments
sh sample.sh --id var1 --value var2


Use an array:

vars=($var)
sh sample.sh --id ${vars[0]} --value ${vars[1]}