I have a file that contains text something like this
SNAPSHOT snap-021ede4a vol-bc3f89c0 completed 2012-11-19T06:05:26+0000 100% 170495546006 850 Created by CreateImage(i-6adc0515) for ami-977dfafe from vol-bc3f89c0
TAG snapshot snap-021ede4a project PAC
TAG snapshot snap-021ede4a Name AWSVA-ADPACLD01V
TAG snapshot snap-021ede4a environment DEV
SNAPSHOT snap-02456b66 vol-c54749a8 completed 2012-01-25T11:40:57+0000 100% 170495546006 15 Created by CreateImage(i-3f40a05a) for ami-8967b1e0 from vol-c54749a8
TAG snapshot snap-02456b66 environment DEV
TAG snapshot snap-02456b66 Name ORACLE10204_WITH_DB_CREATED
TAG snapshot snap-02456b66 project Architecture
I have attached only two entries of the contents of the file, it may contain some 50 entries.
I need to write a shell script such that my output will be as shown below,
The snapshot $snap is created by volume :$vol
The $snap should contain the pink colored value and $vol should contain the red colored value.
That is it should print for each entry.
Required output.
1. The snapshot snap-021ede4a is created by volume :vol-bc3f89c0
2. The snapshot snap-02456b66 is created by volume :vol-c54749a8
Your code works fine for me.
But i have a small doubt.
If i want the output to be as shown below,
1. The snapshot snap-021ede4a is created by volume :vol-bc3f89c0
The details of the volume created are: project PAC , Name AWSVA-ADPACLD01V, environment DEV.
2. The snapshot snap-02456b66 is created by volume :vol-c54749a8
The details of the volume created are: environment DEV , Name ORACLE10204_WITH_DB_CREATED , project Architecture.
How can i accomplish the task?
I tried a lot but am not able to find a solution to it.
Please help me in accomplishing it.