Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. if [ "$#" -ne "1" ]; then
  3. echo ""
  4. echo -e "\033[01;32mLimit checker\033[00m"
  5. echo -e "\033[01;37mUsage:\033[01;33m $0 process_name\033[00m"
  6. echo ""
  7. exit 0
  8. fi
  9.  
  10. return-limits(){
  11. for process in $@; do
  12. process_pids=`ps -C $process -o pid --no-headers | cut -d " " -f 2`
  13.  
  14. if [ -z $@ ]; then
  15. echo "[no $process running]"
  16. else
  17. for pid in $process_pids; do
  18. echo "[$process #$pid -- limits]"
  19. cat /proc/$pid/limits
  20. done
  21. fi
  22. done
  23. }
  24.  
  25. return-limits $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement