≡ Menu

Shell Script To Display The Running Process Running On The System Every 30 Seconds For 3 Times Only

  1. #!/bin/bash
  2. # Write a shell script to display the process running on the system for every
  3. # 30 seconds, but only for 3 times.
  4. # -------------------------------------------------------------------------
  5. # Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
  6. # This script is licensed under GNU GPL version 2.0 or above
  7. # -------------------------------------------------------------------------
  8. # This script is part of nixCraft shell script collection (NSSC)
  9. # Visit http://bash.cyberciti.biz/ for more information.
  10. # -------------------------------------------------------------------------
  11. #
  12. # for loop 3 times
  13. for r in 1 2 3
  14. do
  15. #see every process on the system
  16. echo "**************************** x^x^x ****************************"
  17. ps -e
  18. echo "**************************** x^x^x ****************************"
  19. #sleep for 30 seconds
  20. sleep 3
  21. # clean
  22. done

Comments on this entry are closed.

  • smita desai

    what is the sample output