sed 's@.* \(/.*jpg\)@![](\1)@' a
... image:: /_static/... image:: /birthday_party.bmp
$ more b
/_static/footer/AD/left_footer1.png
$ sed 's@.*/\(.*.png\)@\1@' b
left_footer1.png
如何将一个完整的路径保存到捕获组中而不止是档案名称
... image:: /_static/... image:: /birthday_party.bmp
... image:: /_static/... image:: /birthday_party.bmp
... image:: ... image:: /_static/AD/help_me.jpg
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |