#!/bin/bash
# tute15

clear
echo -e "#################################### 15 ######################################\n"
echo -e "I use dvbstream to lock on to a channel either for viewing or saving or"
echo -e "streaming on our lan.\n"
sleep 5
echo -e "Here's what a dvbstream command looks like:\n"
sleep 5
echo -e "dvbstream qam 64 -cr 3_4 -gi 8 -bw 7 -tm 8 -f 536625 -ps 102 103 8192\n\n"
sleep 5
echo -e "Note in that command that the only thing dvbstream is interested in is \" -bw 7 \""
echo -e "and so far all we have gotten to by piping commands is \"BANDWIDTH_7_MHZ\"\n."
sleep 5
echo -e "What I need to do is pipe two more times through sed like this;\n"
sleep 5 
echo -e "\t| sed -e 's/BANDWIDTH_//' | sed -e 's/_MHZ//'\`\t"
sleep 5
echo -e "\n\nThe complete command now looks like this:\n \n"
sleep 5
echo -e "sed -n '/ABC1/p' channels.conf | sed /#/d | awk -F ":" '{ print \$4 }' | sed -e 's/BANDWIDTH_//' | sed -e 's/_MHZ//'\`\n\n"
sleep 2

#sed -n '/ABC1/p' channels.conf | sed /#/d | awk -F ":" '{ print $4 }' | sed -e 's/BANDWIDTH_//' | sed -e 's/_MHZ//'

sed -n '/ABC1/p' channels.conf \
| sed /#/d | awk -F ":" '{ print $4 }' \
| sed -e 's/BANDWIDTH_//' | sed -e 's/_MHZ//'
sleep 2
echo -e "\nYou will note directly above is the number seven. This is the value I want and this "
echo -e "value can be assigned to a variable to be used in running dvbstream from a script."
sleep 5