Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 aws cli jmespath 查询中,例如输出["a","a","b","a","b"],我如何提取它的唯一值以获得["a","b"]?
["a","a","b","a","b"]
["a","b"]
不幸的是,目前这在 jmespath 中是不可能的。
这不是您要求的,但我使用了以下内容:
aws ... | jq -r ".[]" | sort | uniq
这将转换["a", "a", "b", "a"]为:
["a", "a", "b", "a"]
a b