I have a string like AxxBCyyyDEFzzLMN and I want to replace all the occurrences of x, y, and z with _.
How can I achieve this?
I know that echo "$string" | tr 'x' '_' | tr 'y' '_' would work, but I want to do that in one go, without using pipes.
AxyzB? Three underscores or one? - David Ztr '[xyz]'will replace[and], too. The argument should be simply a list of characters (though ranges likea-zare okay, and in some implementations, POSIX character classes like[:digit:]). - tripleee