小编jod*_*ell的帖子

Bash进程替换和退出代码

我想转向以下内容:

git status --short && (git status --short | xargs -Istr test -z str)

这得到了我想要的结果,即将输出镜像到stdout并对结果进行零长度检查,使其更接近:

git status --short | tee >(xargs -Istr test -z str)

不幸的是,它返回了tee的退出代码(总是为零).

有没有办法优雅地获得替代过程的退出代码?

[编辑]

我现在要使用以下内容,它会阻止运行相同的命令两次,但似乎要求更好的东西:

OUT=$(git status --short) && echo "${OUT}" && test -z "${OUT}"

bash

6
推荐指数
2
解决办法
1945
查看次数

对AWS Cloudfront进行基准测试

有没有人对使用AWS/Cloudfront作为响应时间的CDN的效果进行基准测试?

performance amazon-web-services amazon-cloudfront

5
推荐指数
1
解决办法
2176
查看次数