shell - How to replace a sentence with space on the basis of a pattern if it occurs in the middle of a sentence -


suppose have line this:

aaaa ---- bbbb 

i want erase ----bbbb part, want keep aaaa part in file. how can it?

using sed:

s='aaaa ---- bbbb' echo "$s"|sed 's/--* bb*/foo/' aaaa foo 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -