我在变量名中有以下JSON它在containerDefinitions下的末尾TASK_DEFINTIION
有一个\r字符"image": "700707367057.dkr.ecr.us-east-1.amazonaws.com/php-demo:feature-feature01\r"
我TASK_DEFINITION_AFTER= 'echo $TASK_DEFINTIION | sed "s/\\r//g"'
用来删除\r但似乎它正在删除所有隐藏的回车符,但没有删除作为常规字符可见的回车符。
任何帮助都会受到高度评价。
{
"memory": "1024",
"networkMode": "awsvpc",
"family": "ecs-php-demo",
"placementConstraints": [],
"cpu": "512",
"executionRoleArn": "arn:aws:iam::700707367057:role/ecsTaskExecutionRole",
"volumes": [],
"requiresCompatibilities": [
"FARGATE"
],
"taskRoleArn": "arn:aws:iam::700707367057:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"memoryReservation": 256,
"environment": [],
"name": "ecs-php-demo",
"mountPoints": [],
"image": "700707367057.dkr.ecr.us-east-1.amazonaws.com/php-demo:feature-feature01\r",
"cpu": 0,
"portMappings": [
{
"protocol": "tcp",
"containerPort": 8080,
"hostPort": 8080
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs",
"awslogs-group": "/ecs/ecs-php-demo"
}
},
"essential": true,
"volumesFrom": []
}
]
}