shithub: rc

Download patch

ref: cffe0a8c867e90cc8334edac55fecf98fab64125
parent: ae16de57e6157c784d2857813c400c7a7dcb857b
author: qwx <qwx@sciops.net>
date: Sun Sep 18 19:24:13 EDT 2022

lstk: list last process by default, not first

--- a/bin/lstk
+++ b/bin/lstk
@@ -12,7 +12,7 @@
 	shift
 }
 psd $p
-p=`{psd $p | sed 's/^[^ ]+[ ]+([^ ]+).*/\1/;1q'}
+p=`{ps | awk -v 'P='^$p '$6 == P{ p=$2 } END{ print p }'}
 if(~ $#p 0){
 	echo no proc $p >[1=2]
 	exit noproctohand