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

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -