The officially official Devuan Forum!

You are not logged in.

#1 2023-06-29 11:10:22

soren
Member
Registered: 2023-04-30
Posts: 110  

Doas and Sudo - Bash-Completions

Just thought would post this here as i find it peculiar behavior.

I dont have sudo installed and use doas lately. I found that if I create an alias in .bashrc such as alias sudo="doas" i can get the full functionality of sudo bash completion as long as i keep using the sudo command in the terminal. Its good i like it but it begs the question can doas be implemented in bash-completion as well?

Workaround is this semi solution.

as root

cp /usr/share/bash-completion/completions/sudo /usr/share/bash-completion/completions/doas

then replace all instance of sudo in the doas file.

Source: https://github.com/scop/bash-completion/issues/505

Edited: Fixed alias command.

Last edited by soren (2023-06-30 09:01:58)

Offline

#2 2023-06-30 03:24:31

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 601  

Re: Doas and Sudo - Bash-Completions

Great!

I'd call that a "Freedom Hack", because you have restored your freedom to use doas.

Thank you for sharing.


pic from 1993, new guitar day.

Offline

#3 2023-06-30 08:59:25

soren
Member
Registered: 2023-04-30
Posts: 110  

Re: Doas and Sudo - Bash-Completions

GlennW wrote:

Great!

I'd call that a "Freedom Hack", because you have restored your freedom to use doas.

Thank you for sharing.

Was not sure where to put this. At first it was a question then i answered my own question. Maybe the mods could transfer this thread to "Freedom Hacks"?  http://dev1galaxy.org/viewforum.php?id=25
And you are welcome.

Last edited by soren (2023-06-30 09:00:04)

Offline

#4 2023-07-05 17:50:55

yeti
Member
From: I'm not here: U R halucinating
Registered: 2017-02-23
Posts: 310  

Re: Doas and Sudo - Bash-Completions

I'm using https://github.com/nutta-git/bash-compl … tions/doas and so far it behaves as expected:

~$ doas aptitude --<tab><tab>
--assume-yes          --no-gui              --show-versions       --verbose
--display-format      --prompt              --simulate            --width
--download-only       --quiet               --sort                --without-recommends
--help                --show-deps           --target-release      --with-recommends
~$ doas aptitude --β–ˆ

<πš‹πš˜πšπš’ πš˜πš—πš•πš˜πšŠπš='πšπš˜πšŒπšžπš–πšŽπš—πš.πš‹πš˜πšπš’.πš’πš—πš—πšŽπš›π™·πšƒπ™Όπ™»="π™³πš’πšœπšŠπš‹πš•πšŽ π™Ήπš‚!";'>
π”“π”©π”’π”žπ”°π”’ π”©π”’π”žπ”³π”’ 𝔢𝔬𝔲𝔯 π”£π”žπ”²π”©π”±π”° 𝔦𝔫 𝔱π”₯𝔒 𝔰𝔒𝔠𝔱𝔦𝔬𝔫 π”Ÿπ”’π”©π”¬π”΄ π”žπ”«π”‘ 𝔑𝔬𝔫'𝔱 𝔣𝔬𝔯𝔀𝔒𝔱 𝔱𝔬 π”²π”«π”°π”²π”Ÿπ”°π” π”―π”¦π”Ÿπ”’!

Offline

#5 2023-07-08 08:51:54

soren
Member
Registered: 2023-04-30
Posts: 110  

Re: Doas and Sudo - Bash-Completions

Thanks Yeti, i will try that script.

Offline

Board footer