我有这个代码
...
SERVERCONNECTION=$(wget --quiet -O - http://xx:yy@127.0.0.1:10001/server | grep connections | awk '{print $36}')
有时url得到响应,然后我想杀死wget进程并将SERVERCONNECTIION变量设置为0.
使用--timeout=seconds,即设置wget进程的超时
SERVERCONNECTION=$(wget --timeout=5 --quiet -O - http://xx:yy@127.0.0.1:10001/server | grep connections | awk '{print $36}')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1729 次 |
| 最近记录: |