I am writing a Bash script to store the version number of Virtualbox, but cannot succeed.
My Script is:
#!/bin/bash
installed_virtualbox=$(virtualbox --version) # --version this is what I want to change
I tried
virtualbox --version
virtualbox -v
virtualbox -V
virtualbox --Version
all seems to open the virtualbox instead of output.
virtualbox --help
gives the version number, but the output is too long to store in variable and use later.