The officially official Devuan Forum!

You are not logged in.

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

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

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: 644  

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: 142  

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: 334  

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: 142  

Re: Doas and Sudo - Bash-Completions

Thanks Yeti, i will try that script.

Offline

Board footer