For a line that I added to /etc/sudoers, for example:
t ALL=(ALL) NOPASSWD: /path/to/myscript /path/to is in PATH of the current user t, but not in PATH of root.
$ sudo /path/to/myscript works without password, but do I need to specify the pathname of the script every time I run the script with sudo?
$ sudo myscript [sudo] password for t: sudo: changeCpuFreq.sh: command not found doesn't work even with password, because myscript's path isn't in PATH of root.
$ sudo -E env "PATH=$PATH" myscript [sudo] password for t: works with password, because PATH of t is copied to that of root, but the problem is that it still needs password.
Thanks.