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

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -