I want a command/function, preferably bash, that takes a word/string and a number and shifts the letter positions in the word by that number, rotating the overflow back to the beginning.
e.g. with input stack and 2 the output would be cksta
I have thought about using tr but I couldn’t quite figure out how to make it general so as to work with any word, and not just translating specific letters from a target word.
You can use
bash‘s built-in string manipulation:Example: