事情是我想使用 shell script 格式化我的文本文件内容。内容是这样的:
http://copyright.gov.in Inlinks:
fromUrl: http://mhrd.gov.in/ anchor: Copyright
fromUrl: http://mhrd.gov.in/hi/home anchor: कॉपीराइट
fromUrl: http://mhrd.gov.in/?fontsize=normal anchor: Copyright
fromUrl: http://mhrd.gov.in/?contrast=high anchor: Copyright
fromUrl: http://mhrd.gov.in/?fontsize=large anchor: Copyright
fromUrl: http://mhrd.gov.in/sitemap anchor: Copyright
fromUrl: http://mhrd.gov.in/?fontsize=small anchor: Copyright
fromUrl: http://mhrd.gov.in/hi anchor: कॉपीराइट
fromUrl: http://mhrd.gov.in/?contrast=normal anchor: Copyright
我希望格式化输出为:
http://copyright.gov.in -> http://mhrd.gov.in/
http://copyright.gov.in -> http://mhrd.gov.in/hi/home
http://copyright.gov.in -> http://mhrd.gov.in/?fontsize=normal
等等