changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/psu

changeset 7243: 34f64dcbbc25
parent: efddda59690a
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
1 #!/bin/rc
2 # psu - ps for just one user
3 rfork e
4 flags=()
5 while (! ~ $#* 0 && ~ $1 -*) {
6  flags = ($flags $1)
7  shift
8 }
9 
10 # sed -n p rather than grep so that we get buffered writes.
11 # this is a huge difference in drawterm.
12 switch($#*){
13 case 0
14  ps $flags | sed -n '/^'$user' /p'
15 case 1
16  ps $flags | sed -n '/^'$1' /p'
17 case *
18  echo Usage: psu '[ps-flags] [ user ]' >[1=2]
19  exit usage
20 }