get header of domains by bash script

℡╲_俬逩灬. 提交于 2020-01-22 02:55:14

问题


I write 10 domains in test.csv and trying to get the header of these 10 domains. but it won't read contents 1 by 1.

and run this script

for j in test.csv
do

awk -F',' '{ print "$1" }' $j | curl -Is | cat >> b.txt

done

I have about 10 million domains, and trying to get header by script. Any way possible ?


回答1:


curl won't read URLs from stdin unless you tell it to do so. And you don't need a loop for this (assuming you have multiple files). What you're looking for is:

awk -F',' '{ print "url=" $1 }' file1 file2 file3 ... | curl -s -I -K- > out

Notice the -K-, it tells curl to read command line arguments from stdin.



来源:https://stackoverflow.com/questions/59234715/get-header-of-domains-by-bash-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!