The default path for linux should usually be /usr/bin/sudo
, but for all unix, or even some customized linux distros, it could really be anywhere (say /usr/local/bin/sudo
, or even something link /opt/bin/sudo
, or /srv/bin/sudo
, etc.)
Assuming it is in your PATH—which it should be— then you should discover it by using which
sudocmd=`which sudo`
Because the installation prefix on the same distribution could vary, depending on how it is installed.