Tuesday, 28 July 2015

PR(04): Create a program for display list of active processes, display the information of Process, Display the global priority of the process, Change the priority of process, & kill the process.



while true
do
                echo "1.Display active process in shell.";
                echo "2.Display information about process";
                echo "3.Display the Global priority of process";
                echo "4.Change the priority of process.";
                echo "5.kill the process";
                echo "6.Exit.";
                echo "Enter your choice";
                read ch;
                case $ch in
                1)
                                ps
                                ;;
                2)
                                ps -ef
                                ;;
                3)
                                ps -axl | more
                                ;;
                4)
                echo "Enter the pid of open process";
                read pid
                ps -axl | grep $pid
                echo "Enter the prioity for the process";
                read pr
                renice $pr $pid
                ;;
                5)
                echo "Enter the pid  to kill process";
                read pid
                kill $pid
                ;;
                6)
                exit
                ;;
esac
done

No comments:

Post a Comment