code: plan9front

ref: f466d4a75b8027f195c79e67d898c0da23811f47
dir: /rc/bin/wdoc2txt/

View raw version
#!/bin/rc

switch($#*){
case 0
	exit
case 1
	switch($1){
	case *.rtf
		pub/rtf2text $1 >[2]/dev/null | plumb -i -d edit -a 'action=showdata filename='$1
	case *.doc *
		doc2txt $1 | plumb -i -d edit -a 'action=showdata filename='$1
	}
	exit
case *
	for(i in *)
		wdoc2txt $i
}