Data file example
I look for primary and * to isolate the interesting slot number.
slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'`
Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk indicates the interesting slot, "Slot 1"
sed -n '/\s+"$gslot"/p; /Touch:/p'
Output
My question is :
How do I get only the Touch line following the Slot 1 line ? (marked that interesting line with a "-G"
Ofcourse I could have missed something, ... looking through books and the web but I havent found anything that addresses this issue.