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

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

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

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