Non english su command

Post your Gambas programming questions here.
Post Reply
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Non english su command

Post by BruceSteers »

Hi all.

I'm making a gambas upgrader and i have a function in it that allows you to type the su password in at the start of the compile process so you do not have to when it gets to running 'make install'

It does this by when the make install command is sent to the terminal it reads the terminal output.

Now for sudo this is easy.
if you use sudo you get the following prompt...
[sudo] Password for user:

So easy peasy just monitor the last terminalview linf for text begining with [sudo] , and will be the same in all languages.

but su is different.
when typing su -c "command" you get this prompt...
Password:

And i fear it's probably a different word in all languages fo su? or am i wrong? does su command ask "Password:" in all cases?

Thanks.
Bruce
If at first you don't succeed , try doing something differently.
BruceS
User avatar
PJBlack
Posts: 184
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Non english su command

Post by PJBlack »

Code: Select all

LANG  =       de_DE.utf8

sudo  :       [sudo] Passwort für xxxxxxxxxx:
su -c :       Passwort:
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Non english su command

Post by BruceSteers »

PJBlack wrote: Saturday 16th January 2021 3:24am

Code: Select all

LANG  =       de_DE.utf8

sudo  :       [sudo] Passwort für xxxxxxxxxx:
su -c :       Passwort:
dag nabbit!

Thank you.
I got a few replies to this on the gambas m/l , not one of them actually answering my simple question.
I salute you sir :)

I'm thinking my auto-password thing might just have to only work on sudo not su :(

Bruce
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Non english su command

Post by BruceSteers »

Well it turns out that su is very different.
Unlike sudo if i use TerminalView.Input() or even Desktop.SendKeys() su does not accept the password input.

So looks like the auto-type password is going to be a sudo only feature.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
PJBlack
Posts: 184
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Non english su command

Post by PJBlack »

bruce ... for a long time i never had a system under my fingers that NOT have sudo ... and even then: someone who like to program a computer should be able to install sudo ... so what
Post Reply