Last active
February 3, 2019 09:58
-
-
Save praton1729/b53026b4f39e55412a2926b5d1df6542 to your computer and use it in GitHub Desktop.
A bash script that forms a dict file from the text files in the cwd.
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 | |
if [ -e words.dict ] | |
then | |
echo -e "Deleting the old dict file...\n" | |
rm ./words.dict | |
echo -e "Creating a new dict file...\n" | |
for f in $(ls *.md);do tail -n +2 $f | sed 's|[,.:-\;]||g' | sed 's|\s\s| |g' | tr ' ' '\n' | grep -v -e '^$' | uniq >> words.dict; done | |
echo -e "Done creating a new dict file...\n" | |
else | |
echo -e "Creating a new dict file...\n" | |
for f in $(ls *.md);do tail -n +2 $f | sed 's|[,.:-\;]||g' | sed 's|\s\s| |g' | tr ' ' '\n' | grep -v -e '^$' | uniq >> words.dict; done | |
echo -e "Done creating a new dict file...\n" | |
fi | |
#cat Advance_I.md Basic_VII.md Basic_VI.md | sed 's|[,.:-\;]||g' | sed 's|\s\s| |g' | tr ' ' '\n' | grep -v -e '^$' >> words.dict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment