Using sed:
s='aaaa ---- bbbb'
echo "$s"|sed 's/--* bb*/foo/'
aaaa foo
質問
Suppose I have a line like this:
aaaa ---- bbbb
I want to erase the ----bbbb
part, but I want to keep the aaaa
part as it is in the file. How can I do it?
解決
Using sed:
s='aaaa ---- bbbb'
echo "$s"|sed 's/--* bb*/foo/'
aaaa foo