GcinInstallBoshiamy: liu.sh

File liu.sh, 0.7 kB (added by anonymous, 4 years ago)
Line 
1 #!/bin/bash
2
3 if [ "$1" == "" ]; then
4   echo
5   echo Usage:
6   echo "      " "$0" \[filename\]
7   echo
8   echo Example:
9   echo "        " "$0" LIU5.CIN
10   echo
11   exit
12 fi
13
14 if [ ! -f "$1" ]; then
15   echo "$0": No such file
16   exit
17 fi
18
19 echo
20 echo Generating noseeing.gtab ...
21
22 iconv -f CP950 -t UTF-8 -c "$1" | \
23 sed -e 's/^%prompt 無蝦米/%prompt 嘸蝦米/' \
24     -e 's/^%dupsel 9/%space_style 1/' \
25     -e 's/^\] 〔/\] 〕/' | \
26 grep -v '^%quick ' | \
27 grep -v '^%sel1st ' > noseeing.cin
28 rm -fr noseeing.gtab
29 gcin2tab noseeing.cin > /dev/null 2>&1
30
31 if [ -f noseeing.gtab ]; then
32   echo
33   echo Done.
34   echo
35   echo Please copy noseeing.gtab to $HOME/.gcin or /usr/share/gcin/table
36   echo
37   exit
38 fi