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

This commit is contained in:
cinap_lenrek 2020-12-23 01:43:29 +01:00
parent e45c7480b6
commit 4675de1ba0
3 changed files with 6 additions and 7 deletions

View file

@ -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'

View file

@ -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'
}

View file

@ -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'
}