Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sudo commands.

Status
Not open for further replies.

jxfish2

Technical User
Jan 24, 2002
183
US
I need some help!

I can run a sudo command from the command line without issue... This command line contains a dynamically substituted email address...

sudo /tmp/helpme johndoe@johndoe.com

However, if I try to call the same exact command from within a script, I lose the value of this email address... The new value defaults to /dev/null...

I've tried enclosing the 2nd and 3rd pieces of the command in single "'"s and double '"'s...

I've tried negating the blank space, by placing a backslash "\" in front of it...

None of these things seem to work...

Remember, the command works properly, and initializes the destination email address, if called from the command line, but not when called from within a script...

If anyone has any suggestions, I'd be happy to hear them.

JCF
 
Hi,

Which shell are you using.

Are you setting all of the pertinent environment variables in your script that are set in your interactive shell?

-Joe
 
What do you get when you use
Code:
ksh -xv myscript
That usually provides a few pointers

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top