bash string replacing a some char with another
Posted
by Amarsh
on Stack Overflow
See other posts from Stack Overflow
or by Amarsh
Published on 2010-05-20T05:18:39Z
Indexed on
2010/05/20
5:20 UTC
Read the original article
Hit count: 247
folks, i have a string like
AxxBCyyyDEFzzLMN
I want to replace all x and y and z with _ so that the output is
A_BC_DEF_LMN
How to do that?
I know a series of tr 'x' '' | tr 'y' '' will work, but I want to do taht in one go, without using pipes
thanks in advance
© Stack Overflow or respective owner