Established method to enable suid scripts?

Randal L. Schwartz merlyn at
Sat May 14 19:25:01 UTC 2011

>>>>> "Pan" == Pan Tsu <inyaoo at> writes:

Pan> ...a shebang can be written with sudo in mind, e.g.

Pan>   #! /usr/bin/env -S sudo sh
Pan>   id

(Untested) why not just "#!/usr/local/bin/sudo" ?  It'll be given the
filename as an argument.

Aside: In general, almost every use of "#!/usr/bin/env XXX" as a
solution is wrong.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at> <URL:>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See for Smalltalk discussion

More information about the freebsd-questions mailing list