Merge pull request #39 from lbonanomi/master

Test if the current user is sudo-su'd into this session
pull/40/head
@trimstray 2018-12-27 09:35:35 +01:00 committed by GitHub
commit aa2adcbee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

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