I try to write a script to get the version of my distro so that I can pass it to a variable.
The following command is what I wrote to achieve the result.
lsb_release -ar | grep -i release | cut -s -f2
The unwanted output:
No LSB modules are available.
18.04
As you can see, the No LSB modules are available message is the unwanted part.
Since I prefer my script to be portable across servers, I don't want to install any extra packages beside utilizing the lsb_release -a command.