I have the follow file with JSON data (`file.txt`):

```json
{
  "files": [
    "/path/to/index.js",
    "/some/other/path.txt",
    "/another/path/to/file.js"
  ]
}

```

I'd like to do the following:

1. Find each file ending in `.js`. One simple regex might be: `/".\*.js"/
2. Loop over each file above and do something with it. E.g maybe call `echo $FILENAME`
3. Replace that line with a relative path. E.g. `"./file.js"`

So the output file might look like:

```json
{
  "files": [
    "./index.js",
    "/some/other/path.txt",
    "./file.js"
  ]
}

```

Bash is the only thing available to use in the environment I am working in. Is it possible to do the above?

I've seen examples of `awk` and other things that look more advanced, but I'm not sure where to even start.