特定の文字が含まれる最後の行
grepとtail -n1を組み合わせてもできるけど、
たとえば行末に$という文字がある最終行の表示。
> sed -n '/\$$/h;${g;p}' file
参考:http://www.ishilab.net/~ishihara/tips/sed.txt
grepとtail -n1を組み合わせてもできるけど、
たとえば行末に$という文字がある最終行の表示。
> sed -n '/\$$/h;${g;p}' file
参考:http://www.ishilab.net/~ishihara/tips/sed.txt