Linux sed命令返回截断的输出

时间:2017-11-23 05:15:42

标签: linux sed

我有一个示例命令aws describe-something command,它返回以下输出。

{
    "Image": [
        {
            "Name": "tyy1", 
            "VpcConfig": {
                "SubnetIds": [
                    "subnet-800jhoic9"
                ], 
                "SecurityGroupIds": [
                    "sg-jj-popttf5"
                ]
            }, 
            "EnableDefaultInternetAccess": false, 
            "ImageBuilderErrors": [], 
            "Platform": "WINDOWS", 
            "State": "SNAPSHOTTING", 
            "InstanceType": "stream.standard.medium"
        }
    ]
}

我尝试使用此命令aws describe-something | grep -i State | sed -n -e 's/^.*\"State\": //p'来返回SNAPSHOTTING但是我得到了" SNAPSHOTTING"。如何删除逗号和双引号?

0 个答案:

没有答案