How do I determine if a web page exists with shell scripting?

前端 未结 5 435
时光取名叫无心
时光取名叫无心 2020-12-02 06:14

I am trying to make a program that can convert a series of manga scans into one pdf file, and I don\'t want to have to attempt to download the picture to determine if I have

5条回答
  •  执念已碎
    2020-12-02 06:55

    Use cURL to obtain the status code and check for required values.

    status=$(curl -s --head -w %{http_code} http://www.google.com/ -o /dev/null)
    echo $status
    

提交回复
热议问题