Bash string change part of words -


i need change string before printing in bash. did:

${retezec//./d} 

now need change 1 more thing, - _. no idea how add there? in same step $`{retezec//./d;//-/_} , need 1 exeption 1 - ?

it's not possible nest parameter expansion, need 2 expressions:

foo=${retezec//./d} echo "${foo//-/_}" 

you can, however, use external tool recommend stick native shell solution above.

$ echo "foo.-bar" | tr '.-' 'd_' food-bar 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -