ID #1010

náhrada znaků v bashi

stringZ=abcABC123ABCabc
echo ${stringZ/abc/xyz}           # xyzABC123ABCabc
                                  # Replaces first match of 'abc' with 'xyz'
echo ${stringZ//abc/xyz}          # xyzABC123ABCxyz
                                  # Replaces all matches of 'abc' with  'xyz'

Značky: -

Související záznamy:

K tomuto záznamu nemůžete připojit komentář.