I can not seem to get the awk command to get the second column of data.
Bash Code:
filter_data=$(awk "{if(/$filter:/) print $2}" < scanresults_temp.txt)
printf "$filter_data \n"
The $filter variable is either the value of Download or Upload that gets passed into the shell script. So awk uses the term Download or Upload to search for the proper row.
The file contents are:
Testing download speed................................................................................
Download: 51.13 Mbit/s
Testing upload speed................................................................................................
Upload: 57.38 Mbit/s
I am trying to get just the numbers and not anything else, ex, 51.13
and 57.38
.