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!

run program that has to be run by root

Status
Not open for further replies.

gbonner0906

Programmer
Jan 22, 2009
4
US
I am writing a program in perl for the first time (other than HELLO WORLD which I'm not counting) and I need to know how to open up a new terminal window and run a program that has to be run as root.

What I've got so far is

"gnome-terminal --execute sudo asterisk -vvvvvvc"

but then it asks me for a password and I get stuck. If I enter

"gnome-terminal --execute sudo asterisk -vvvvvvc $password"

on my own, I can achieve the desired effect, but when I try it in perl, my program just freezes and quits responding. Ideas?
 
Oh yeah, I'm using ubuntu 8.10. Forgot to mention that earlier
 
well I think I figured it out.

by using sudo -S you can pipe in a command from stdin so:

echo $password | sudo asterisk -vvvvvvc is what I needed.
 
i am a beginner.
i have a problem running strawberry perl (for win32).
where can i find step by step instructions (such as for real naive people) to use it? - book, site, etc
my final destination is to be able to use a cgi module.
thanks
 
What the hello does your question have to do with this thread?

Maybe you should start on the strawberry perl website.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
simple
i thought that beginners at least would help a beginner
seems that gbonner0906 is a self-sufficient person and thought he may have an answer
 
Maybe you're not familiar with forums. When you have a new question you start a new thred and ask your question. Piggy-backing your question onto another thread is considered rude. Start a new thread.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Also start by asking intelligent questions. Saying "I have a problem" is much too vague. Everyone that posts a question has a porblem of some kind or another, thats a given. What you want to do is give details about your specific problem..... in a new thread.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top