Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/rc/fdict

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

rfork ne

db='*'
dot=()
cmd=DEFINE

fn usage {
	echo Usage: fdict [-lm] [-d database] word >[1=2]
	exit usage
}

if(~ $#* 0)
	usage

while(! ~ $#* 0 && ~ $1 -*) {
	switch ($1) {
	case -d
		db=$2
		shift
	case -l
		show='SHOW DB'
	case -m
		cmd=MATCH
		dot=.
	case -*
		usage
	}
	shift
}

{
	if(! ~ $# 0)
		echo $cmd $db $dot $*
	echo $show
	echo QUIT
} |
con -nrl tcp!dict.org!2628 | 
sed '/^[0-9][0-9][0-9] /d; /^$/d; /^.$/d'

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.