Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
http://www.keshav.com/hack-public/hms/pick400/Seg_1/pick400_1079.tk http://www.keshav.com/hack-public/hms/pick400/Seg_1/pick400_1080.tk
如何仅提取网址“pick400_ * ”的最后一个单词。我需要以下格式的输出
pick400_1079.tk pick400_1080.tk
这就是你可以这样做的方式bash:
bash
while read line; do basename $line; done < inputfile
或者,
while read line; do echo ${line##*/}; done < inputfile
使用 awk:
awk -F "/" '{print $NF}' inFile
使用sed:
sed
sed -e 's=.*/==' INPUT