I've done this before.
I've read numerous posts in this forum, and googled even more on how to save the result of a shell command into a variable. All of them say to do this
VAR="$(shell_command)"
echo $VAR
or
VAR=`shell_command`
echo $VAR
But I'm trying to do this
VAR="$(python2.7 -V)"
echo "Version is $VAR"
or
VAR=`python2.7 -V`
echo "Version is $VAR"
and I see
Python 2.7.14
Version is
IOW I'm not storing the result? Why is this? I just want pure bash and want to understand why it doesn't do what I expect it to do. Thanks!