Bug 1569893
Summary: | Privileged-access requiring aliases fail when executed as sudo-user. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | ricky.tigg |
Component: | bash | Assignee: | Siteshwar Vashisht <svashisht> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 28 | CC: | admiller, kasal, kdudka, svashisht |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-20 08:37:39 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
ricky.tigg
2018-04-20 08:08:15 UTC
Aliases are expanded on the begin of your command line only. So if your command line starts with 'su' or 'sudo' and none of them is an alias, no other aliases are expanded. bash probably does not support what you are looking for but you can try zsh, which supports global aliases: % alias -g remo='dnf -y remove' % sudo remo ... Global aliases expand anywhere on the command line. Please use it with care. Existing entry is replaced by '% alias -g remo='dnf -y remove''. Messages resulting from implementation are: – 'bash: fg: no job control' (displayed when opening the terminal). – $ source ~/.bashrc bash: fg: %: no such job Please re-read comment #1. The command to define global alias will not work in bash. I was talking about zsh (another shell interpreter). Moreover, the '%' sign was not supposed to be typed at all. It just denotes the command prompt ('%' is the default prompt in zsh, similar to '$' in bash). Since comment #3 completed comment #1, solution is clear enough. Thanks |