aboutsummaryrefslogtreecommitdiff
path: root/bin/""
blob: ac5cda8bf2054338f0cec25df31702eadd12ce14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/local/plan9/bin/rc

PROMPT='[^ 	]*[%;$#][ 	]+'

" $* | 
	grep -v '^'$PROMPT'""' | 
	tail -1 | 
	tee >{wc -l >/tmp/qq.$pid} | 
	tee /dev/stderr | 
	9sed 's/^	'$PROMPT'//' | 
	rc

if(~ `{cat /tmp/qq.$pid} 0){
	rm /tmp/qq.$pid
	echo no such command found
	exit notfound
}
rm /tmp/qq.$pid
exit 0