shithub: binrc

ref: b82b52776f6c6cb34a2bca222e3c92ac918ae517
dir: /pshot/

View raw version
#!/bin/rc
# pshot - see procs taking sys time, sorted

ps | awk '{
	nnl = 0
	for(i = 1; i <= NF; i++){
		if(index($4, "0:00") != 0){
			nnl = 1
			continue
		}else if(i == 1){
			printf "%s ", $4
		}else if(i == 4){
			printf "%s ", $1
		} else {
			printf "%s ", $i
		}
	}
	if(!nnl)
		print ""
}' | sort -gr