#! /Bin/bash # installstardictif [[-f $ (whichstardict)] thenecho "" echo "Youhavestardictinstalled." echo "" & nbs
#! /Bin/bash
# Install stardict
If [[-f $ (which stardict)]
Then
Echo ""
Echo "You have stardict installed ."
Echo ""
Echo "Downloading dictionary files ..."
Echo ""
Sleep 3
Else
Sudo apt-get install stardict-y
Echo "Now stardict has been installed ."
Echo ""
Echo "Downloading dictionary files ..."
Echo ""
Sleep 3
Fi
# Definations
Passwd = "Ubuntu: ubuntuftp"
Url = "http: // $ passwd@ftp.ubuntu.org.cn/stardict.sourceforge.net"
Dir = "$ HOME/. stardict/dic"
# General dictionaries: 21 Century bi- Al, langdao, Wei, Oxford, Longman, and computer majors
Dict_1 = "stardict-21shijishuangxiangcidian-2.4.2.tar.bz2"
Dict_2 = "stardict-langdao-ce-gb-2.4.2.tar.bz2"
Dict_3 = "stardict-langdao-ec-gb-2.4.2.tar.bz2"
Dict_4 = "stardict-merrianwebster-2.4.2.tar.bz2"
Dict_5 = "stardict-oxford-gb-2.4.2.tar.bz2"
Dict_6 = "stardict-longman-2.4.2.tar.bz2"
Dict_7 = "stardict-computer-2.4.2.tar.bz2"
If [! -D $ dir]
Then
Mkdir-p $ dir
Fi
For dict in $ dict_1 $ dict_2 $ dict_3 $ dict_4 $ dict_5 $ dict_6 $ dict_7
Do
Wget-c $ url/$ dict-P $ HOME & tar jxf $ HOME/$ dict-C $ dir
Rm-rf $ HOME/$ dict
Echo ""
Done
Echo "Run 'stardict & 'in terminal, enjoy it ."
Echo ""