今天遇到意見奇怪的事情,在用sed 匹配內容的是時候匹配不出來
我做了下測試
文件內容是這樣的
用sed -n '/[0-9]$p/' test.txt 匹配無結果
但是用 sed -n '/[0-9]%/' p test.xt 卻能匹配到結果
操作符不都是在引號裏面的嗎?
今天遇到意見奇怪的事情,在用sed 匹配內容的是時候匹配不出來
我做了下測試
文件內容是這樣的
用sed -n '/[0-9]$p/' test.txt 匹配無結果
但是用 sed -n '/[0-9]%/' p test.xt 卻能匹配到結果
操作符不都是在引號裏面的嗎?
$ cat aa123456789 $ sed 'N;$!D' aa89但是爲什麼下面的結果卻是這樣? sed 'n;$!d' aa13579