Process related commands list the processes for the current shell, display information about processes, display global priority of the process, change priority of the process with default arguments.
#!/bin/bash
while true
do
echo "MENU"
echo "1. process status"
echo "2. nice value"
echo "3. renice value"
echo "4. global priority"
echo "5. exit"
echo "enter ur choice"
read ch
case $ch in
1) echo "process status are"
ps -al
;;
2) echo "enter the nice value"
read n1
echo "enter the command"
read cmd
echo "nice value is"
nice -$n1 $cmd &
ps -al
;;
3) ps -al
echo "enter the pid"
read p1
echo "enter the renice value"
read rv
echo "renice value is"
renice +$rv $p1
ps -al
;;
4) echo "global priority"
ps -ecl
;;
5) exit
;;
*) echo "invalid choice"
;;
esac
done
#!/bin/bash
while true
do
echo "MENU"
echo "1. process status"
echo "2. nice value"
echo "3. renice value"
echo "4. global priority"
echo "5. exit"
echo "enter ur choice"
read ch
case $ch in
1) echo "process status are"
ps -al
;;
2) echo "enter the nice value"
read n1
echo "enter the command"
read cmd
echo "nice value is"
nice -$n1 $cmd &
ps -al
;;
3) ps -al
echo "enter the pid"
read p1
echo "enter the renice value"
read rv
echo "renice value is"
renice +$rv $p1
ps -al
;;
4) echo "global priority"
ps -ecl
;;
5) exit
;;
*) echo "invalid choice"
;;
esac
done
Blogger Comment
Facebook Comment