I have a simple bash shell script which is driving me bonkers. All I want to do is run a command which returns a result which I will then use in another command. The result of the first command returns a location on my hard drive with spaces. Here's what I have...
# Get list of virtual machines. VMname will hold the address of the .vmx file
VMname=`./vmrun list`
echo $VMname
# Get list of snapshots
command="./vmrun listSnapshots "
command=$command"'"
command=$command$VMname
command=$command"'"
echo $command
snapshotList=`$command`
It looks like when I try to append the single quotes around the $VMname it only appends to the left, ie I only the left single quote is appended. Is there something silly I am doing wrong? This really is driving me crazy!