Your advice did help in your last post. After typing your code manually, everything went smoothly and worked first time. Awesome job. Thank you again, as I feel like I did learn a great deal. Star has been awarded :).
Ivan
Cool, but I get error message after typing sh translate.txt:
Enter the word in english:
sea house
awk: translate.awk:4 aawhile (getline < "lang_french" ) {
awk: translate.awk:4: ^ invalid char 'a' in expression
note that small aa in aawhile and 'a' have little angled line above...
lhurwitz, thanks for your response, this gives me an idea of how it all works.
Salem, nice and rich code you have posted :).
I have created all the files above, but only problem is that I am not sure as to how do I make it all work. How do I make a call to your code, so that I am prompted for...
Hi,
I am complete newbie, as some of you know already...
I have a file which contains two columns, separated by space. First column has english words and second column has words in french, like:
house maison
meal repas
sea mer
water eau
etc...
I use this code to run the translation:
echo...
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...
Thanx squash and marsd. I will try these in couple of hours.
marsd wrote:
"Let me see: you want a low level , reversible, cipher created in the shell that is not trivially breakable and that allows you to secure your files? Let me stop laughing for a second..okay done."
My reason for...
Hi all,
How easy or difficult would it be to write a plain text encryption/decryption shell script to a most basic level?
Text would be stored in a file, with ability to produce an encrypted file output.
Decryption should restore original plain text.
Is this possible or do I need 3rd party...
Hehe, I just need a basic word, like dog OR cat. If user makes a mistake or enters something different from the words in a file, god help me. This will suffice, as I am trying to see how awk command works at its most basic level.
I wouldn't know where to start with user's input error checking or...
Ok,
This one seem to work fine, and is based on pavNell's example:
echo "Enter the word in english:"
read string
echo "Same word in french is:"
awk ' { if ($1 == word)
print $2 }' word="$string" lang_words.txt
echo
echo "press any key to continue"
read...
Tried cruel's code and this is the output:
Enter the word in english:
car
Same word in french is:
voiture
echarpe
echarpe is displayed, as there is another word that contains car - scarf (echarpe) :)
Just tried pavNell code, and this is the response:
Same word in french is: awk: cmd. line:2: if ($1 == word) {print $2}
awk: cmd. line:2: ^ invalid char ' ' in expression
Hi everyone,
I am working on a small language translation program, and am stuck trying to use awk.
I have so far created three files:
1. main menu file
2. lookup file with awk, which is called from main menu file
3. language file containing english, french and serbian words, like:
sea mer...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.