Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am completely new to Unix scripting with zero knowledge in it and have the below scenario can you please help me with the complete working script,
1. Get the string input from the user
2. Convert it to ASCII
3. Increment each character's ASCII value by 2. If the input value contains Y or Z it should be converted to A or B accordingly, same way the string may have special characters and numbers as well and they must be converted accordingly.
4. Form the new word
5. Store this in a file
Input : ABCD
Output : CDEF
and this output should be stored at the Value 1 location in a file like,
Value 1 : CDEF
Value 2 : XYX
This file will act as a config file and should be used in another script 2
Script 2 should read these values and before proceeding it should convert it back to original value (i.e. ABCD - should perform the reverse operation).
This is something like encrypting and decryption but its very primary. I am not worried about any security issues by achieving this logic as i am going to implement it on some log files with no value.
This looks like Ceasar cipher to me. Are you taking a computer security class? Well, I had this class but I worked on C, not script, where I just incremented the character by "key" (key is an integer). I believe you can do something similar in bash. Google for "Ceasar cipher in bash script".