#!/bin/bash
# tute14

clear
echo -e "#################################### 14 ######################################\n"
echo -e "Have another look at the complete line for ABC1 and not that \" : \" is used"
echo -e "as a field separator for each of the settings.\n"
sleep 5
grep "ABC1" channels.conf | sed /#/d
sleep 10
echo -e "If I wanted to retrieve just one of those settings, I would use awk.\n"
sleep 4
echo -e "Awk sees these semicolon separated groups as numbered left to right as \$1, \$2,"
echo -e "\$3, \$4, and so on.\n"
sleep 8
echo -e "If I wanted just the fourth field, \"BANDWIDTH_7_MHZ\" I would pipe the complete"
echo -e "ABC1 line into awk like this:\n\n"
sleep 5
echo -e "\tsed -n '/ABC1/p' channels.conf | sed /#/d | awk -F ":" '{ print \$4 }'\n\n"
sleep 5
echo -e "and here's what would come out on the other side:\n\n"
sleep 5
sed -n '/ABC1/p' channels.conf | sed /#/d | awk -F ":" '{ print $4 }'
sleep 5