-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Lines 75 to 81 in 637c5a5
| am_i_root() { | |
| if [[ "$(id -u)" = "0" ]]; then | |
| true | |
| else | |
| false | |
| fi | |
| } |
can be simplified to:
am_i_root() {
[[ "$(id -u)" = "0" ]]
}
or even better:
am_i_root() {
(($(id -u) == 0))
}
or ever better:
am_i_root() {
((${EUID:-${UID:-$(id -u)}} == 0))
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels