the best way to get the full paths and such as root is. be root. edit /etc/sudoers and put user ALL=(ALL) NOPASSWD: ALL then instead of sudo gainroot, just do su - and the password is rootme.