Using tr command I want to convert Hello into Hii. My command was:


But the result was Hiiii. What did I do wrong? What is the right way to do it?


To replace Helloby Hii you could use:


tr works different. Using tr both character sequences are handled as lists. The first character of the first list is replaced by the first character of the second list. So, H is replaced by H, e is replaced by i and so on.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.