Bash tr -s command -


so lets have several characters in email don't belong. want take them out tr command. example...

jsmith@test1.google.com msmith@test2.google.com zsmith@test3.google.com 

i want take out test[123]. using command tr -s 'test[123].' < email > mail. 1 way have tried 2 or 3 have attempted not work intended. output trying ...

jsmith@google.com msmith@google.com zsmith@google.com 

you use sed.

$ sed 's/@test[1-3]\./@/' file jsmith@google.com msmith@google.com zsmith@google.com 

[1-3] matches characters falls within range 1 3 (1,2,3). add in-place edit -i parameter save changes made.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -