I'm still learning unix and I need to know if there is a way to perform the following actions.
Is there any way I can echo a read variable, and in the process, dissect it letter by letter, and assign specific commands to every letter? For example, if the regular echoed output would be "cat", how would I make c, a, and t execute different commands? Is this possible?
I have attempted various methods using fold to split the letters up into their own lines. I just need a way to make the letters equal a command.
It would pretty much look like this:
read variable echo $variable | fold -w 1
Am I on the right track?