I have a text with a list of paths and I'd like only select one specific path to a yml
inside all directories with a specific prefix (foo
).
So when I run grep -Eo "^config/foo.*/db.yml"
, it also selects other db.yml
files in subdirectories and that's not what I'm expecting :(
Actual output:
config/footestto/db.yml
config/foodummy/db.yml
config/footestto/prod/db.yml
Expected output:
config/footestto/db.yml
config/foodummy/db.yml
Could you please help me? there could be something wrong with my regex. Thanks.