wget or curl from stdin

后端 未结 5 1607
青春惊慌失措
青春惊慌失措 2020-12-30 03:20

I\'d like to download a web pages while supplying URLs from stdin. Essentially one process continuously produces URLs to stdout/file and I want to pipe them to wget or curl.

5条回答
  •  礼貌的吻别
    2020-12-30 04:16

    You can do this with cURL, but your input needs to be properly formatted. Example alfa.txt:

    url example.com
    output example.htm
    url stackoverflow.com
    output stackoverflow.htm
    

    Alternate example:

    url stackoverflow.com/questions
    remote-name
    url stackoverflow.com/documentation
    remote-name
    

    Example command:

    cat alfa.txt | curl -K-
    

提交回复
热议问题