Squash,
I tried your code, but I am obviously doing something completely wrong. I am not sure how to integrate your code into my application I wrote so far. This is what I am trying to do:
Bellow is a code for my menu, from where I can choose various options for my VERY basic translation program.
****************************
# menu for language translation program
quit=n
clear
while test "$quit" = "n"
do
echo "Word translation:"
echo "-----------------"
echo " 0 -- English to French"
echo " 1 -- English to Serbian"
echo
echo " 2 -- French to English"
echo " 3 -- French to Serbian"
echo
echo " 4 -- Serbian to English"
echo " 5 -- Serbian to French"
echo
echo "Language dictionary options:"
echo "----------------------------"
echo " 6 -- List all currently stored words"
echo " 7 -- Add new word"
echo " 8 -- Amend existing word"
echo " 9 -- Delete word"
echo " 10 -- Quit the menu"
echo " 11 -- Encryption Test"
read option
case $option in
0) sh lang_engfra.txt;;
1) sh lang_engser.txt;;
2) sh lang_fraeng.txt;;
3) sh lang_fraser.txt;;
4) sh lang_sereng.txt;;
5) sh lang_serfra.txt;;
6) sh lang_list.txt;;
7) sh lang_append.txt;;
8) sh lang_amend.txt;;
9) sh lang_remove.txt;;
10) quit=y;;
11) sh lang_crypttest.txt;;
*) echo "unknown option";;
esac
echo
sleep 1
done
*******************************
As you can see, I added option 11, which will make a call to (at the moment (lang_crypttest.txt), where I have cut and pasted your code. This is what top section of this file looks like at the moment as I have changed path to my files:
************************
A=/$home/ivan/test # Location of this file
B=/$home/ivan/test # Location of encryped file (can be the same)
C=zz.crypt # encrypted file
D=zz.txt # temporary text file to be encrypted
if [ $1 = help ]
then
clear
echo
echo "Usage: pass <condition> "
echo
echo "Possible conditions are:"
.
.
.
**************************
I am doing something fundamentally wrong in here, but as a complete newbie, I cannot see what for the life of me. I am happy that I managed to write rest of the program from scratch while learning a lot in the process, but this encryption is much more complicated than anything else I did so far, 7 days to be precise.
Let the newbie bashing begin
Ivan K. Grant