I hope my question won't offend you, but I have a problem working with characters. I'm using an Oracle VM environment, where I've installed a Linux image. I have to create a script which will take 2 arguments: a word and a key. I have to encrypt the given word using the key. The problem is that I have to change the word letter by letter and I don't really know how to do that. My script's code:
#!/bin/bash
INPUT=$1
KEY=$2
while [ $[#KEY] -lt $[#INPUT] ]
do
KEY=$KEY$KEY
done
nr=$[#INPUT]
for i in {0..nr}
do
echo "$(INPUT[i])"
done
I don't have any experience in Linux commands and, especially, in characters manipulation (I used to use them quite often in C, but it seems that Linux has different rules for characters).