I am trying to install zfs through shell script while installation I am getting some error so, to automate it fully, I want to get the version to be installed from error itself. For all other commands I am getting the error in one variable but for one command its not coming at all. I tried every solution possible.
I need output of this command
sploutput=$(sudo dkms install -m spl -v $version)
echo $sploutput
echo $sploutput # This is giving nothing.
I tried wrapping it around string also like "sploutput=$(sudo dkms install -m spl -v $version)"
echo "{sploutput}"
Nothing seems to work.