≡ Menu

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

#!/bin/bash
# Write a shell script to display the process running on the system for every
# 30 seconds, but only for 3 times.
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project 
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
#
# for loop 3 times
for r in 1 2 3
do
	#see every process on the system
	echo "**************************** x^x^x ****************************"
	ps -e
	echo "**************************** x^x^x ****************************"
	#sleep for 30 seconds
	sleep 3
        # clean
done
{ 1 comment… add one }
  • smita desai May 24, 2010, 7:33 am

    what is the sample output

Security: Are you a robot or human?

Leave a Comment