检测 curl 文件下载何时完成

Detect when curl file download is completed

我正在 shell 脚本上使用 curl 下载文件:

do shell script "curl -f http://example.com/file -o ~/Desktop/file.doc"

如果文件下载完成,有没有办法detect/catch?

do shell script 同步工作。

下载完成后执行下一行代码。