I'm writing a shell script which edits a docker-compose.yml file (running on MacOS).
I'm trying to delete a block which looks like so and is located at the end of the file:
microservice-itai-ms:
image: ms-itai-ms:master
environment:
NODE_ENV: 'development'
NPM_TOKEN: 'SECRET'
ports:
- "3022:3000"
depends_on:
- "redis-cluster"
I'm running the following command in order to remove this block:
sed -i.bak '/.*itai-ms.*/,+9d' docker-compose.yml
9 is the number of lines including the pattern's line.
When I run the above command, I get the following error:
echo docker-compose.yml | sed -e '/.*itai-ms.*/,+9d'
sed: 1: "/.*itai-ms.*/,+9d
": expected context address
What am I doing wrong?