How to Detect Linux Distribution with Bash

How to Detect Linux Distribution with Bash

bash

This is a simple bash function to get Linux dIstro information such as distribution, architecture and Kernel version. I have managed to use this function in many of my scripts when sending monitoring emails.

The Basic Function

The function simply queries lsb-release for the distribution information and adds it to  a variable. lsb-release is not in all distributions, however if that is missing it will check other areas that this information might be.