shithub: riscv

Download patch

ref: e8c3eb87d27f95a9a0b89a93164dba42427659ec
parent: aa0a20ed6ec2cd3d042dd1d8b93195eb14440763
author: Matthew Veety <mveety@gmail.com>
date: Wed May 13 14:48:46 EDT 2015

Added ukill(1): Kills all processes started by a user

--- /dev/null
+++ b/rc/bin/ukill
@@ -1,0 +1,12 @@
+#!/bin/rc
+rfork e
+if(~ $#1 0){
+	USER=`{cat /dev/user}
+}
+if not {
+	USER=$1
+}
+PROCS=`{ps | grep $USER | awk '{print $2}'}
+for(i in $PROCS){
+	echo '@{echo kill>/proc/'^$i^'/note}'
+}