D
D
Denis S2022-03-11 12:54:58
linux
Denis S, 2022-03-11 12:54:58

How to run compgen using sudo?

Good afternoon.
There is a Go product that uses bash autocomlete (command[TAB]).
Command completion works correctly for both normal user and super user. However, if we try to use autocompletion by running the command with sudo, it will throw an error.


$ sudo ./util cl[TAB]
bash: compgen: warning: -C option may not work as expected
Command not found: compgen
Display all 221 possibilities? (y or n)

I checked compgen doesn't start when using sudo.
$ sudo compgen -c
sudo: compgen: command not found

What needs to be done to run compgen using sudo?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Fedoseev, 2022-03-11
@wushyrussia

which compgen
says:?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question