put wget downloads to pipe
wget -O - -o /dev/null http://google.com
来源:https://serverfault.com/questions/25779/how-do-i-pipe-a-downloaded-file-to-standard-output-in-bash
实际应用:
下载某1024社区的某帖子里的全部图片,就可以使用如下:
这里awk, sed, grep 联合起来用的活生生的例子
#!/usr/bin/bash #注意sed 不要使用global replacement: /g wget -O - -o /dev/null $1 | awk '/ess-data/' | sed 's/ess-data=/\ness-data=/g' | grep "^ess-data" | sed "s/'/\n/" | grep "^http" | sed "s/'/\n/" | grep "^http" | uniq | sort | xargs wget -cq