小编Cha*_*ase的帖子

在终端中使用带有curl的"if"语句?

我正在使用此命令来使用curl获取页面的响应代码:

curl -s -o /dev/null -w "%{http_code}" 'https://www.example.com'
Run Code Online (Sandbox Code Playgroud)

如果响应代码是200,那么我想删除计算机上的某个文件.如果不是200,则不应该做任何事情.

最简单的方法是什么?

linux terminal command-line curl

3
推荐指数
1
解决办法
941
查看次数

标签 统计

command-line ×1

curl ×1

linux ×1

terminal ×1