vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Dear All, I found the following interesting script to kill processes on the net. I wonder if this can be modified to ignore specific users even when their idle time is greater than 45? #!/bin/ksh who -u > /idleuser/aaa #cutting the position of the hour cut -c 39-49 /idleuser/aaa > /tayyab/bbb grep ":" /idleuser/bbb > /idleuser/ccc IFS='[: ]' while read a b pid; do if [ $a+0 -gt 0 ] || [ $b+0 -gt 45 ]; then kill -9 $pid fi done < ccc I am just learning and I have no expertise in script programming and at the same time I am mindful not to corrupt the system. Thanking you in advance. Felix Mwango Mutale |