Below is my input file:
---
{
"date":"2015-09-24",
"title":"Getting Started with Git",
"template":"post",
"thumbnail":"content/thumbnails/test.jpeg",
"slug":"getting-started-with-git",
"categories":[ "cat1", "Focus", "Mustang" ],
"tags":[ "Fiesta", "Focus", "Mustang" ]
}
---
#Hello
---
This is sample
---
```
var x=1;
entry.forEach(function(item){
x=x++;
})
```
What I am expecting in output is, lines between first 2 '---'
{
"date":"2015-09-24",
"title":"Getting Started with Git",
"template":"post",
"thumbnail":"content/thumbnails/test.jpeg",
"slug":"getting-started-with-git",
"categories":[ "cat1", "Focus", "Mustang" ],
"tags":[ "Fiesta", "Focus", "Mustang" ]
}
How can I achieve it? Using awk, I am able to achieve this only if i replace '---' with some string like 'start'/'end'.
awk '/start/{f=1;next} /end/{f=0;exit} f' $FILE_PATH