Can any one explain what this code will do

ccc_con,CCC_CON,0

Above is the input for this code

#!/usr/bin/bash
my_path=`dirname $0`
T_table=$1
S_table=$2
P_table=$3
#Star new code
while read ${my_path}/arch_table_list.txt
{
awk -F "," '{print $1}' ${my_path}/arch_table_list.txt ${S_table}
awk -F "," '{print $2}' ${my_path}/arch_table_list.txt ${T_table}
awk -F "," '{print $3}' ${my_path}/arch_table_list.txt ${P_table}
}
echo $S_table $T_table $P_table

Can anyone explain me this script

The commas are not actually there when invoking the script, are they?

Either way, the code does something, in my opinion, very silly. For each line in this "arch_table_list.txt", it :

  • prints out the first column of arch_table_list.txt, followed by the first column of the file CCC_CON.
  • prints out the second column of arch_table_list.txt, followed by the second column of the file ccc_con
  • prints out the third column of arch_table_list.txt, followed by the third column of the file "0"

That seems a bit crazy.