我刚刚在脚本中看到以下内容,但不确定它的含义:
.............
started=$STATUSDIR/.$EVENT_ID-started
errs=$STATUSDIR/.$EVENT_ID-errors
# started is used to capture the time we started, so
# that it can be used as the latest-result marker for
# the next run...
>"$started"
>"$errs"
# store STDERR on FD 3, then point STDERR to $errs
exec 3>&2 2>"$errs"
..............
Run Code Online (Sandbox Code Playgroud)
具体来说,是行开头的“>”。该脚本实际上失败并显示“没有这样的文件或目录”。变量都是通过辅助脚本提供的,似乎没有任何逻辑来创建它所抱怨的目录。
这对谷歌来说并不是最容易的事情,所以我想我应该在这里问它,这样未来的 bash 黑客可能会找到你们可爱的人能够提供的答案。