I have a variable ($line) that is defined in the bash/shell script as
$line = "abc:123:def:345"
I need to get this column2 = “123” to a variable without printing it
The command extracts the column, but also prints the variable
FILE=$1
while read line
do
awk -F: '{print $2}' <<< "$line"
done < $FILE
Thanks.
0