利用你学过的知识点(awk、grep),想办法根据要求截取字符串
字符串:http;//www.51xit.top/root/123.html
vi 123.txt ##文件插入字符串
http://www.51xit.top/root/123.html
要求;
1.取出www.51xit.top/root/123.html
2.取出123.html
3.取出http://www.51xit.top/root/123.html
4.取出:http:
5.取出; http://
6.取出:root/123.html
7.取出:123
1.取出www.51xit.top/root/123.html
cat 123.txt |awk -F ‘//’ ‘{print $2}’ ###//分割截取第二段
cat 123.txt |grep -o “www.*” ##www,匹配后面的
2.取出 123.html
cat 123.txt |awk -F ‘/’ ‘{print $5}’ #######/分割截取第五段
cat 123.txt |grep -o "[0-9].html"