[Gambas-user] sudo or gksudo in SHELL?

José Luis Redrejo jredrejo at ...626...
Fri Feb 22 18:25:01 CET 2008


2008/2/22, Maximillian Von Kloisterheim <maximvonk at ...626...>:
>
> José Luis Redrejo wrote:
> > do you need a graphic interface? in that case you'll have to use shell
> "gksu
> > \"chown... \" .. "
> > but if you don't need the graphic interface you can use sudo directly.
> Take
> > a look at "man sudo" and you'll know a lot of different options to do
> it.
> > Regards.
> >
> > José L:
>
>
> Thanks José, the command works just fine when I type the password into
> the debug pane, but this is one of the reasons I was trying to use
> gksudo: To get a graphical password request for me to type into.
>
> When the program is compiled there will be no debug pane to type into so
> I need something else.
>
> For example, is there some way I can type my password into my own
> program or is there another way to use sudo from SHELL?
>
>
I think you could do it by a combination of "expect" and "su"
su -u user -c command
will ask for the password and with "expect you could answer it.
Also, using a gambas process open as a Stream and using Input/Output
functions might be possible.

Regards.
José L.



More information about the User mailing list