spell (331B)
1 #!/usr/local/plan9/bin/rc 2 3 . 9.rc 4 spellflags=() 5 deroffargs=() 6 fflag='' 7 for(x){ 8 switch($x){ 9 case -[abcvx] 10 spellflags=($spellflags $x) 11 case -f 12 fflag=$x 13 case * 14 if(~ $fflag -f) { 15 spellflags=($spellflags -f $x) 16 fflag='' 17 } 18 if not deroffargs=($deroffargs $x) 19 } 20 } 21 22 deroff -w $deroffargs | sort -u | sprog $spellflags