Hi,
I am new to shell scripting, I ahve written a shell script which would extract me data, but my problem is I want to add a column name to my output. Using grep and sed I am getting my data from the input file.
Sample data
name : eric
name : tom
name : sean
My output using grep and sed is :
eric
tom
sean
But I want my output as
name
eric
tom
sean
I tried searching as much as possible in google and in the forum, but no luck. If it is a repeated question, I am extremely sorry. If someone can help me out in this regard, that would be great. I tried using
awk '/name/ {print $2}' test.tmp , but this gives me only eric, tom,etcc..but name is not getting displayed.
Your valuable help is really appreciated.
Thanks in Advance
Sandeep