tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* sudo and script
@ 2000-09-29  8:22 M selcukkaraca
  0 siblings, 0 replies; only message in thread
From: M selcukkaraca @ 2000-09-29  8:22 UTC (permalink / raw)
  To: tru64-unix-managers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-09-29  8:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-29  8:22 sudo and script M selcukkaraca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox