3
[[ $# == 0 ]] && echo "Usage: ${0##*/} SKK-JISYO [SKK-JISYO-CDB]" 1>&2 && exit 1
4
[[ ! -f $1 || ! -r $1 ]] && echo "${0##*/}: $1: can't read" 1>&2 && exit 2
5
[[ $# == 1 ]] && set $1 $1.cdb
7
[[ ! -d $dir || ! -w $dir ]] && echo "${0##*/}: $dir: can't write" 1>&2 && exit 3
8
tmpf=`tempfile --directory=$dir`
9
trap "[[ -e $tmpf ]] && rm $tmpf; exit 4" INT TERM
12
s = substr($0, index($0, " ") + 1)
13
print "+" length($1) "," length(s) ":" $1 "->" s
18
' $1 | cdbmake $2 $tmpf