I have file with many name: I want to replace only the first one
sed -i "s/\(name:\).*/\1 ${NEW_VALUE}/" ./myFile
Input
- martin:
name: Martin D'vloper
job: Developer
skills:
- python
- perl
- pascal
- tabitha:
name: Tabitha Bitumen
job: Developer
skills:
- lisp
- fortran
- erlang
output to change only the first name Martin D'vloper
- martin:
name: NEW VALUE!!!
job: Developer
skills:
- python
- perl
- pascal
- tabitha:
name: Tabitha Bitumen
job: Developer
skills:
- lisp
- fortran
- erlang
It changed all names
I saw something with different syntax
sed '0,/pattern/s/pattern/replacement/' filename
but I can't change sed to this because the dynamic value Could you advise me how to replace only the first one with my syntax ?