Re: [Gambas-user] Shell sudo

2013-01-31 Thread MinnesotaJon
Thanks, Les -- I had this same problem, and you solved it for me.  For other
readers, here is the command adapted for Gambas3:

Shell sudo -S chmod 0777 ~/myfilename  EOF\nmypassword\nEOF   

Note:  chmod 0777 is just an example of a chmod code

The newline code \n should NOT have spaces before it or after it.  If you
have excess spaces, this will be interpreted as part of the shell command,
and you'll get an error.



--
View this message in context: 
http://gambas.8142.n7.nabble.com/Shell-sudo-tp17654p40876.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Shell sudo

2009-12-25 Thread M. Cs.
I've found a better solution: I've created a module file with a process.
This can be triggered from within the main program.


' Gambas module file
PUBLIC hProcess AS Process
PUBLIC wins AS Form
PUBLIC szoveg1 AS TextBox
PUBLIC SUB ReadPassword()
DIM black AS Button
wins = NEW Form
wins.Width = 150
wins.Height = 300

black = NEW Button(wins)
black.Width = 100
black.Height = 25
black.X = 25
black.Y = 150
Object.Attach(black, ME, runty)
szoveg1 = NEW TextBox(wins)
szoveg1.Width = 100
szoveg1.Height = 25
szoveg1.X = 25
szoveg1.Y = 120
szoveg1.Password = TRUE
wins.Center
wins.Show()
hProcess = SHELL sudo  'apt-get install PACKAGE' FOR INPUT OUTPUT
END

PUBLIC SUB runty_Click()
PRINT #hProcess, szoveg1.Text
wins.Delete()
END
'
PUBLIC SUB Process_read()
DIM sOutput AS String
  LINE INPUT #LAST, sOutput
  PRINT sOutput

END

The only problem is, that I'm trying to create an universal solution, which
is distro independent. But it seems nearly impossible to do, since there are
a conflict between su and sudo commands, or their acceptance by the
different distributions.
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Shell sudo

2009-12-24 Thread Les Hardy

sudo allows you to pass a password to the shell with -S
The following should do it.

sudo -S apt-get install PACKAGENAME  EOF
PASSWORD
EOF


Regards
Les Hardy


M. Cs. wrote:
 I'd like to make my app able to download and install packages via apt-get
 (or any other command-line package manager). How can I do that? I know it
 will need the user's password but how can I pass the command?
 The simple SHELL sudo apt-get install ... won't do the thing!
 Thanks!
 --
 This SF.Net email is sponsored by the Verizon Developer Community
 Take advantage of Verizon's best-in-class app development support
 A streamlined, 14 day to market process makes app distribution fast and easy
 Join now and get one step closer to millions of Verizon customers
 http://p.sf.net/sfu/verizon-dev2dev 
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Shell sudo

2009-12-23 Thread M. Cs.
I'd like to make my app able to download and install packages via apt-get
(or any other command-line package manager). How can I do that? I know it
will need the user's password but how can I pass the command?
The simple SHELL sudo apt-get install ... won't do the thing!
Thanks!
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user