Following Details are on a file called repo.
Date: 2010/10/19 19:05:06
Description:
Created by rolandb.
Type: local
I want to get the extract the details separately from a shell script. I have the following code
#!/bin/bash
Date=`awk -v s="Date" 'index($0, s) == 1' repo`
Description=`awk -v s="Description" 'index($0, s) == 1' repo`
Type=`awk -v s="Type" 'index($0, s) == 1' repo`
echo $Date
echo $Description
echo $Type
It does not capture the line in description, as it is in the next line, The output is like :
Date: 2010/10/19 19:05:06
Description:
Type: local
How can i capture the line under the Description: from the shell script ?