Relatively new to Linux but I'm trying to solve a problem.
I'm trying to make a cryptogram solver script where I use tr to easily replace the "cryptic" letters with the solved letters. I have the cryptogram as an all-lowercase text file crypt.txt. When I make replacements, the replacement letters will be uppercase to distinguish them.
My problem is that I also want those letters to change color.
I took this code from a different post I found from a search on these forums:
cat mylog | sed ''/START/s//`printf "\033[32mSTART\033[0m"`/''
and edited it for my use. My general format for letter replacing say, a "k" with an "L", is:
cat crypt.txt | tr k L | sed ''/L/s//`printf "\033[32mL\033[0m"`/''
but this only works if the letter is by itself e.g. not in the middle of a word. I've tried adding * to each side of L but was unsuccessful.
Any help would be appreciated! Thanks. This is my first post so hello everyone
Thanks rudic, I tried that code but nothing changed. I can get the original code I used to work as long as the objective letter is by itself e.g. not part of a 2+ letter word.
---------- Post updated at 18:08 ---------- Previous update was at 18:04 ----------
which on a terminal will look like
Dear RudiC,
jereLyab5 has just replied to a thread you have subscribed to entitled -
Trying to Lake cryptograL script - in the UNIX for DuLLies Questions &
Answers foruL of Unix & Linux ForuLs.
This thread is located at:
http://www.unix.coL/showthread.php?t=264178&goto=newpost