Merge pull request #2 from lbonanomi/who

test if the current user is sudo-su'd into this session
This commit is contained in:
lbonanomi 2018-12-26 20:04:05 -05:00 committed by GitHub
commit 2e28c6c0da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1227,6 +1227,12 @@ ___
who -b
```
###### Detect a user sudo-su'd into the current shell
```
[[ $(who -m | awk '{ print $1 }') == $(whoami) ]] || echo "You are su-ed to $(whoami)"
```
___
##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen)