当我使用 aws cli 命令时,它会将调试数据添加到其输出中。 有办法让它安静吗
这是我的用例:
# get deployed version
COMMAND="git describe --tags"
aws ecs execute-command --cluster="${CLUSTER}" --task="${TASK}" --container="${SERVICE}" --command="${COMMAND}" --interactive > VERSION
问题在于 VERSION 文件的预期内容(只是版本号):
0.0.67
我有类似的东西:
The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.
Starting session with SessionId: ecs-execute-command-123456789abcdefgh
0.0.67
Exiting session with sessionId: ecs-execute-command-123456789abcdefgh.
如何删除调试数据?
我已经尝试添加
--quiet
参数(参数不存在)
并重定向错误输出,没有任何帮助。
我可以看到您的帖子是 2022 年 11 月。此时 aws cli v2 已经可用。我认为这是您正在寻找的选项https://stackoverflow.com/a/66333386/12176490
在 AWS 文档中:
https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html#cli-usage-pagination-clientside
In order of precedence, you can disable all use of an external paging program in the following ways:
Use the --no-cli-pager command line option to disable the pager for a single command use.
Set the cli_pager setting or AWS_PAGER variable to an empty string.
因此,在 aws cli 命令末尾添加
--no-cli-pager
.