I have a text file I've created with server info. I have a little over a hundred servers in this list. For each server, I put the data between asterisks *** so I have a file with the information shown below. What I want do now is put each block between the *** into it's own file called <servername>. Is there a way to do some sort of inclusive grep? Do I need to step up to using perl here? Sorry, I did some scripting at previous employer, got away from it, now I'm back at it, so I'm rusty.
root@server01:/usr/local/bin/getinfo
.
.
some info
.
.
root@server01:
***
root@server02:/usr/local/bin/getinfo
.
.
some info
.
.
***
root@server03:/usr/local/bin/getinfo
root@server01:/usr/local/bin/getinfo
.
.
some info
.
.
root@server01:
***
root@server02:/usr/local/bin/getinfo
.
.
some info
.
.
***
root@server03:/usr/local/bin/getinfo