I need to run a program installed on /opt/godi/sbin (a custom directory). If I add that directory to my PATH, by adding the following line to my .bashrc file
then I can try to run the command just fine (except that it fails because it needs sudo). However, when I try to use sudo:
I get the following error
sudo: godi_console: command not found
Inspecting the PATH variable after using sudo reveals that its not including the same PATH I have as a normal user:
$ sudo sh # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Why is the PATH not the same? Am I doing something wrong? I'm on Debian Jessie and unfortunately I cannot get around the issue by passing sudo the the absolute link to godi_console because godi_console itself also depends on the PATH being correctly set.