I'm afraid you are misunderstanding the meaning of the "repeat" option.
tr, as you correctly infer, is use to translate character sets. You call it with option
tr set1 set2
The idea is that both sets can contain multiple characters, i.e. you can say
tr 'abc' 'def'
and it will replace every
a with a
b with an
e and every
c with an
f. Now, you may want to replace multiple "input" characters with the same output character, say
tr 'abcdefghij' 'xxxxxxxxyz'
This will replace
z. The "repeat" function is meant to make writing this less cumbersome, so the idea is that you can instead write
tr 'abcdefghij' '[x*8]yz'
as shorthand. So it is not meant for what you intend.
Instead, you can try
echo "1234" | sed 's/2/xxx/g'
This will substitute (
s) all occurences (the trailing
xxx. Note that
sed is also far more flexible than that (have a look at the questions tagged as sed for an overview of what is possible).