#!/bin/bash
# gets a word and allows the user to confirm there acceptance that it should be marked.
# added two type of marks and a context viewer
# rob 2008
# cat $BOOK | sed -e 's/\([^a-zA-z0-9]\)/\n/gi' | grep -v '[0-9]' | sort -fu > $FILENAME
FILENAME=cryptowords.sorted
BOOK=stephenson-neal-cryptonomicon.txt
# yes, I do notice that the paramater is never actually used, thankyou
function offerWord() {
echo "do you understand $WORD ?"
echo -n "[y]es / [n]o / [i] looked it up / [c]ontext::"
read ANS
if [ $ANS = "y" ]; then
echo good, try again
cat $FILENAME | sed -e "s/\(^$WORD$\)/#\1/" > $FILENAME.x ; mv $FILENAME.x $FILENAME
elif [ $ANS = "i" ]; then
echo good for you
cat $FILENAME | sed -e "s/\(^$WORD$\)/@\1/" > $FILENAME.x ; mv $FILENAME.x $FILENAME
elif [ $ANS = "c" ]; then
cat $BOOK | grep $WORD | sed -e "s/\b\($WORD\)\b/---[[\1]]---/"
offerWord $WORD
exit
fi
}
WORD=`cat $FILENAME | sort -R | grep -v '#' | grep -v '@' | head -n 1`
offerWord $WORD
daring
sumo
stodgy
chamois
misty
demonstrates
vertex
stretcher
orbits
mountainous
email
root
flog archives
In fact I'm not responsible for anything ever, so there!
Disclaimer:
This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk
I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk