- 論壇徽章:
- 0
|
[root@PANTA-Mtools study]# cat lists
CustomerSet.CUSTOMER_PAIR_UNUSED=2
CustomerSet.LOGOUT_SET_RADIO_DEFAULT=0
CustomerSet.LOGOUT_SET_TIME_DEFAULT=60
CustomerSet.CHART_DEFAULT_TYPE=USD/JPY#1#100_Customer
--------------------------------------------------------------
[root@PANTA-Mtools study]# sed -e '1,/^$/{/^$/d}' lists
CustomerSet.CUSTOMER_PAIR_UNUSED=2
CustomerSet.LOGOUT_SET_RADIO_DEFAULT=0
CustomerSet.LOGOUT_SET_TIME_DEFAULT=60
CustomerSet.CHART_DEFAULT_TYPE=USD/JPY#1#100_Customer
sed -e '1,/^$/{/^$/d}' lists 本意是取出文件第1行到空行之間的所有行,例如結(jié)果為A,
然后是分組命令{/^$/d},我對(duì)其的理解是在結(jié)果A的基礎(chǔ)上再去掉空行,不知道這樣理解的對(duì)不對(duì)。
要是按我的理解,
A為
CustomerSet.CUSTOMER_PAIR_UNUSED=2
CustomerSet.LOGOUT_SET_RADIO_DEFAULT=0
CustomerSet.LOGOUT_SET_TIME_DEFAULT=60
空行xxxxxxxxxxxxxxxxx
執(zhí)行分組命令{/^$/d}后,結(jié)果應(yīng)用
CustomerSet.CUSTOMER_PAIR_UNUSED=2
CustomerSet.LOGOUT_SET_RADIO_DEFAULT=0
CustomerSet.LOGOUT_SET_TIME_DEFAULT=60
可為什么實(shí)際結(jié)果為下面這個(gè)呢? 最后一行不是不在匹配模式中嗎?為什么沒有去掉?請(qǐng)高手解惑!
CustomerSet.CUSTOMER_PAIR_UNUSED=2
CustomerSet.LOGOUT_SET_RADIO_DEFAULT=0
CustomerSet.LOGOUT_SET_TIME_DEFAULT=60
CustomerSet.CHART_DEFAULT_TYPE=USD/JPY#1#100_Customer |
|