I have a script that starts like this:
source /etc/os-release
if [ $NAME = 'Ubuntu' ]
And it runs fine as a normal user. However, if I invoke it like:
$ sudo ./install.sh
I get the following error:
./install.sh: 9: ./install.sh: source: not found
./install.sh: 10: [: =: unexpected operator
Why does that occur when in sudo
mode, and what's required to fix that?