I have below JSON in a variable name TASK_DEFINTIION
It has a \r character at the end of "image": "700707367057.dkr.ecr.us-east-1.amazonaws.com/php-demo:feature-feature01\r"
under containerDefinitions
I am using TASK_DEFINITION_AFTER= 'echo $TASK_DEFINTIION | sed "s/\\r//g"'
to remove the \r but seems it is removing all the hidden carriage return but not removing the one which is visible as regular character.
Any help would be highly appriciated.
{
"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": []
}
]
}