Last active
December 22, 2021 23:59
-
-
Save asamountain/39617cc696d5d8005ad3c3afc51dd8d6 to your computer and use it in GitHub Desktop.
stardict easy installation shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tarball links of dicts | |
tcide=https://web.archive.org/web/20140917131745/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2 | |
jargon=https://web.archive.org/web/20140917131745/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd-jargon-2.4.2.tar.bz2 | |
foldc=https://web.archive.org/web/20140917131745/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_foldoc-2.4.2.tar.bz2 | |
merrian=https://web.archive.org/web/20140917131745/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-merrianwebster-2.4.2.tar.bz2 | |
dictpath=/usr/share/stardict/dic | |
i=1 | |
filecnt=$(ls *.bz2 | wc -l) | |
# sh | |
# 1. download check | |
if [ `ls *.bz2 | wc -l` -gt 0 ]; | |
then | |
echo "already downloaded" | |
else | |
sudo apt-get install sdcv | |
sudo wget -N "$tcide" "$jargon" "$foldc" "$merrian" | |
sudo mkdir -p "$dictpath" | |
fi | |
until [ $i -gt "$filecnt" ]; | |
do | |
echo i: $i | |
filename=$(ls *.bz2 | sed -n "$i"p) | |
sudo tar -xvjf $filename -C $dictpath | |
((i=i+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
READEME
Result
The Dictionaries in sh script
Reference