Became Hot Network Question
2 edited tags
| link
source | link

Filter YAML file content using sed/awk

I have a text file with the following content in it.

$ cat hosts.yml

I would like to filter hosts listed under [prod_env] file in bash. I tried with sed, awk and grep with my limited knowledge, but I am not sure how to filter them.

Example: I would like to print hosts under prod_env and dev_env. so the final output would be: