From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <97021576923801.tru64-unix-managers.marc@archive.invalid> From: M selcukkaraca Date: Fri, 29 Sep 2000 08:22:50 +0000 To: tru64-unix-managers Subject: sudo and script X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=97021576923801 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