code: plan9front

Download patch

ref: 4675de1ba0005597e98d6e183c6df278e9687d1f
parent: e45c7480b612582c40c579c657630aa43b444a72
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 22 20:43:29 EST 2020

kill, slay, broke: dont pollute environment, use $user

--- a/rc/bin/broke
+++ b/rc/bin/broke
@@ -1,8 +1,8 @@
 #!/bin/rc
-U=`{cat /dev/user}
+rfork e
 if(~ $#* 1){
-	U=$1
+	user=$1
 }
-ps | sed -n '/^'$U' .* Broken/s%[^ ]*  *%~>/proc/%
+ps | sed -n '/^'$user' .* Broken/s%[^ ]*  *%~>/proc/%
 s%  *.* (.*)%/ctl # \1%
 s%~%echo kill%p'
--- a/rc/bin/kill
+++ b/rc/bin/kill
@@ -1,8 +1,7 @@
 #!/bin/rc
 rfork e
-U=`{cat /dev/user}
 for(i){
-	ps | sed -n '/^'$U' .* '$i'$/s%[^ ]*  *%~>/proc/%
+	ps | sed -n '/^'$user' .* '$i'$/s%[^ ]*  *%~>/proc/%
 	s%  *.* (.*)%/note} # \1%
 	s%~%@{echo kill%p'
 }
--- a/rc/bin/slay
+++ b/rc/bin/slay
@@ -1,7 +1,7 @@
 #!/bin/rc
-U=`{cat /dev/user}
+rfork e
 for(i){
-	ps | sed -n '/^'$U' .* '$i'$/s%[^ ]*  *%~>/proc/%
+	ps | sed -n '/^'$user' .* '$i'$/s%[^ ]*  *%~>/proc/%
 	s%  *.* (.*)%/ctl} # \1%
 	s%~%@{echo kill%p'
 }