Guest User

Untitled

a guest
Dec 11th, 2019
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. lista=$(ls /proc | grep -E "^[0-9]" | sort -n)
  3. #echo $lista
  4. for p in $lista
  5. do
  6. if [ -e "/proc/$p" ]
  7. then
  8. nazwa=$(sed '1!d' /proc/$p/status | cut -d: -f2)
  9. ppid=$(sed '6!d' /proc/$p/status | cut -d: -f2)
  10. uid=$(sed '8!d' /proc/$p/status | cut -f2)
  11. uid=$(id $uid | cut -d' ' -f1 | cut -d= -f2)
  12.  
  13. echo "$p $ppid $uid $nazwa"
  14. fi
  15. done
RAW Paste Data