aboutsummaryrefslogtreecommitdiff
path: root/bin/""
blob: 9a6d5a5064e710beff5501311af83415900f3059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env $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