problem with script execution

Christian Walther cptsalek at gmail.com
Fri Dec 1 00:03:21 PST 2006


Try adding "#!/bin/sh" as the first new line of your script. Roughly
speaking: This makes the system use /bin/sh as the shell that executes
the script.
Specifying a PATH inside the script might help, too. Scripts have a
very small environment set by default, so your PATH might be just
something like /bin:/usr/bin. If sudo is in /usr/local/bin it won't
work.


Just out of curiosity: What is the "echo * |" supposed to do? From my
point of view the shell will expand "*" to the list of files and
directories in PWD, so "echo *" acts like a simple ls in this context.
This list is piped to sudo. But what does sudo do with these?


More information about the freebsd-questions mailing list