mirror of
https://github.com/trimstray/the-book-of-secret-knowledge
synced 2024-11-26 13:10:18 +00:00
Merge pull request #2 from lbonanomi/who
test if the current user is sudo-su'd into this session
This commit is contained in:
commit
2e28c6c0da
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue