我想使用sed刪除一些行的開頭。目標是在每行中刪除所有字符,直到出現兩個連續的大寫字母。使用sed刪除一行的開頭,直到大寫字
的投入將始終類似於:
1 where did you get ACQUIRE, obtain, come by, receive, gain, earn, win, come into, take
2 I got your letter: RECEIVE, be sent, be in receipt of, be given.
3 your tea is getting cold: BECOME, grow, turn, go.
4 get the children from school: FETCH, collect, go for, call for, pick up, bring, deliver, convey, ferry, transport.
5 the chairman gets £650,000 a year: EARN, be paid, take home, bring in, make, receive, collect, gross; informal pocket, bank, rake in, net, bag.
6 have the police got their man?: APPREHEND, catch.
而且我所要的輸出是:
ACQUIRE, obtain, come by, receive, gain, earn, win, come into, take
RECEIVE, be sent, be in receipt of, be given.
BECOME, grow, turn, go.
FETCH, collect, go for, call for, pick up, bring, deliver, convey, ferry, transport.
EARN, be paid, take home, bring in, make, receive, collect, gross; informal pocket, bank, rake in, net, bag.
APPREHEND, catch.
我建立這個:
sed -n 's/^.*[A-Z]\{2\}//p'
但這表達式也會刪除大寫的單詞。有關如何做到這一點的任何線索?