I have a folder structure like so.
.
└── apps/
├── bo/
│ └── platform/
│ └── values-dev.yaml
├── canary/
│ └── platform/
│ └── values-canary-dev.yaml
├── foo/
│ ├── customer
│ ├── audit
│ ├── platform/
│ │ └── values-foo-dev.yaml
│ └── platform-gb/
│ └── values-foo-dev.yaml
└── bar/
├── customer
├── audit
├── platform/
│ └── values-bar-dev.yaml
├── platform-usa/
│ └── values-bar-dev.yaml
├── platform-ca/
│ └── values-bar-dev.yaml
└── platform-ie/
└── values-bar-dev.yaml
Sorry in advance for the wording.
I'm trying to use bash to find and replace specific string puppy which exists in each of the values-*-dev.yaml files but I only want to change it on files which exist under foo and bar as well as in each platform subdirectory and replace dog with dog
The closest I've gotten is with the following which lists only the files inside foo but for the life of me I cannot figure this out.
find . -type f -path '*foo/platform*' -name 'values-*-dev.yaml'
I thought by wrapping foo in brackets and adding bar it would work but it doesn't
find . -type f -path '*(foo|bar)/platform*' -name 'values-*-dev.yaml'
findaccepts a list of start points. If your directory structure is fixed, you can just start withfind apps/{foo,bar}/platform ...and omit the-pathoption.