例如,我从网址
中抓取这些行wget -qO- http://superman.com/installer/ | grep "something"
href="Superman-Linux-20.0.1222.x64.sh"
href="Superman-Linux-10.0.1222.x64.sh/*fingerprint*/"
href="Superman-Linux-10.0.1222.x64.sh/*view*/"
我只想grep
Superman-Linux-20.0.1222.x64.sh
然后我需要忘记那个
wget http://superman.com/installer/Superman-Linux-20.0.1222.x64.sh
答案 0 :(得分:2)
而不是像这样的grep:egrep -o "Superman-Linux.*\.sh"
一行代表:
wget http://superman.com/installer/$(wget -qO- http://superman.com/installer/ | egrep -o "Superman-Linux.*\.sh")