Skip to content

Instantly share code, notes, and snippets.

@asamountain
Last active December 22, 2021 23:59
Show Gist options
  • Save asamountain/39617cc696d5d8005ad3c3afc51dd8d6 to your computer and use it in GitHub Desktop.
Save asamountain/39617cc696d5d8005ad3c3afc51dd8d6 to your computer and use it in GitHub Desktop.
stardict easy installation shell script
#!/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
@asamountain
Copy link
Author

asamountain commented Aug 26, 2020

READEME

Result

result-screenshot

The Dictionaries in sh script

  1. The Collaborative International Dictionary of English
  2. Jargon File
  3. Free On-Line Dictionary of Computing
  4. Merrian Webster 10th dictionary

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment