[Gambas-user] Strange problem with running Shell on Fedora (code works in IDE but not in executable!!)

Willy Raets willy at ...2734...
Wed Mar 27 19:02:49 CET 2013


On Wed, 2013-03-27 at 18:25 +0100, Willy Raets wrote:
> On Wed, 2013-03-27 at 17:22 +0100, Tobias Boege wrote:
> > Well, there are some vague assumptions I could make about what's going on
> > but none of them would be based on knowledge.
> > 
> > So I just propose something: leave the "echo" out of your command string.
> > Instead connect sudo's stdin to your Gambas program directly and write the
> > password you obtained as
> > 
> > Print #hProcess1, sPassword
> > 
> > immediately after your "Shell" instruction (note that you must open the
> > process "For Read Write" now). _Perhaps_ it would even give a better feeling
> > to sudo when you use "For Input Output" instead of "Read Write"...
> > 
> > Maybe you should add Process1_Error() just in case there is something that
> > could help you.
> 
> Hi Tobias,
> 
> Thanks for your answer and you are right. 
> I did implement a Catch but that won't feed me back errors in the
> process. So I started by adding a Process1_Error handle and now in IDE
> all still runs producing a small difference in output.
> It now outputs exactly the same as when I copy/paste the sFull output
> printed in console to a terminal window and hit enter (1 extra line
> saying: error:nothing to do
> 
> When run from executable I now get something returned from the process
> error handle.
> 
> Seems not yum but sudo is complaining:
> 'sudo: sorry, you must have a tty to run sudo'
> 
> tty I understand as terminal. So apparently when run from executable
> shell seems to act different somehow. I can't quite wrap my head around
> it.
> 
> I will have a look at your suggestion on sending the password using read
> write or input output.
> Could you explain the 'Instead connect sudo's stdin to your Gambas
> program directly' a bit more maybe?

Okay, got what you meant.
I implemented for read write and send password using priny right after
the shell call.
In IDE all still works as before
In Executable same error message as before:
'sudo: sorry, you must have a tty to run sudo'

Any other suggestions?

> 
> Thanks..
> 
> ------------------------------------------------------------------------------
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game 
> on Steam. $5K grand prize plus 10 genre and skill prizes. 
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org








More information about the User mailing list