From: M selcukkaraca <selcuk.karaca () aski ! gov ! tr>
To: tru64-unix-managers
Subject: sudo and script
Date: Fri, 29 Sep 2000 08:22:50 +0000 [thread overview]
Message-ID: <97021576923801.tru64-unix-managers.marc@archive.invalid> (raw)
Greetings,
I have just installed sudo and got a new error in my life !
I am trying to give rights to my programmers to search ( with find) some
files and grep on them. I have seen sudo and installed. I have written a
script (which is myprog), and wanted to use like this
sudo mypog
but it gives me the following error ;
/usr/local/bin/myprog: function: not found
/usr/local/bin/myprog: syntax error at line 12: `}' unexpected
The place where the error talks , I have just defined a script function ;
-----myprog-----
....
#Gets user input and assings it to a standard variable $FOutput
function GetInput {
echo ${QText}"\c"
read UserInput
FOutput=${UserInput:-$DefInput}
} --->> it gives error here...
.....
I want to ask
1- is it safe to run a shell script with sudo ? ( I know it is dangerous
with setuid, for this reason I donloaded sudo ...)
2- how can I correct the problem, Can't I call a shell function within a
script running with sudo ...
TIA...
selcuk.karaca@aski.gov.tr
Unix sys Admin
ASKI - ANKARA
reply other threads:[~2000-09-29 8:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox