file=/tmp/log
export file
addurls() {
{ while URL= read -r url; do echo $url; echo $url >> $file; done }
}
export -f addurls
techmeme() {
xidel -s $feed --extract '//description' | ack '^<A HREF' | awk -F\" '{ print $2 }' \
| addurls
}
export -f techmeme
feeds=(
'https://www.techmeme.com/feed.xml'
'https://www.memeorandum.com/feed.xml'
'https://mediagazer.com/feed.xml'
)
for feed in $feeds; do
#techmeme
sem -j 1 "techmeme"
done;
sem --wait
我正在尝试使用sem
并行执行操作,但似乎无法通过管道传输