Question : How to parse the output of a command in a Bash script

I have a bash script that runs the code seen below. It executes the command ec2-create-volume which outputs :
VOLUME  vol-eb8a7b12    1               us-east-1a      creating        2009-03-25T01:27:13+0000

I need to parse this output to put vol-eb8a7b12 into a variable.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
if [ ! $(RM_SPACE ${CREATE_EBS[1]}) ]; then
    ec2-create-volume --snapshot $(RM_SPACE ${CREATE_EBS[2]}) --availability-zone $(RM_SPACE ${CREATE_EBS[0]})
  elif [ ! $(RM_SPACE ${CREATE_EBS[2]}) ]; then
    ec2-create-volume --size $(RM_SPACE ${CREATE_EBS[1]}) --availability-zone $(RM_SPACE ${CREATE_EBS[0]})
  else
    ec2-create-volume --size $(RM_SPACE ${CREATE_EBS[1]}) --snapshot $(RM_SPACE ${CREATE_EBS[2]}) --availability-zone $(RM_SPACE ${CREATE_EBS[0]})
  fi
Open in New Window Select All

Answer : How to parse the output of a command in a Bash script

output=(`bashscript`)
variable=${output[1]}
Random Solutions  
 
programming4us programming4us