Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #http://i.imgur.com/l4Gd0pq.jpg
- #!/bin/sh
- usr=$1
- shift
- for f in $*
- do
- printf `echo $f | awk -F / '{print $NF}'`
- echo ":"
- awk -v u="$usr" '{
- if ($1 ~ u) {
- if ($9 ~ ":[0-9][0-9]") {
- if ($10 ~ "sudo") {
- print $11;
- }
- else {
- print $10;
- }
- }
- else if ($10 ~ ":[0-9][0-9]") {
- if ($11 ~ "sudo") {
- print $12;
- }
- else print $11;
- }
- }
- }' $f | awk -F / '{print $NF}' | awk -F - '{print $NF}' | sort | uniq
- echo
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement