Advertisement
se7enuts

333

May 30th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #http://i.imgur.com/l4Gd0pq.jpg
  2.  
  3. #!/bin/sh
  4. usr=$1
  5. shift
  6. for f in $*
  7. do
  8. printf `echo $f | awk -F / '{print $NF}'`
  9. echo ":"
  10. awk -v u="$usr" '{
  11. if ($1 ~ u) {
  12. if ($9 ~ ":[0-9][0-9]") {
  13. if ($10 ~ "sudo") {
  14. print $11;
  15. }
  16. else {
  17. print $10;
  18. }
  19. }
  20. else if ($10 ~ ":[0-9][0-9]") {
  21. if ($11 ~ "sudo") {
  22. print $12;
  23. }
  24. else print $11;
  25. }
  26. }
  27. }' $f | awk -F / '{print $NF}' | awk -F - '{print $NF}' | sort | uniq
  28. echo
  29. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement