marjun marjun - 2 months ago 16
Bash Question

iterating csv and running tcl script in shell script

Im reading a csv file and removing header and passing all the arguements to a tcl script, the script is running for only 1 row from the CSV file but not iterating the records in CSV. Did I missed any looping logic? Please help thanks in advance

#!/bin/bash
read_properties()
{
i=1
sed 1d FF_CONFIG_FILE.csv | while IFS=',' read -r arguments;
do
run_script arguments
done
}

run_script()
{
exec TCL_sqoop_script.sh arguments
}

read_properties

Answer

could you try without exec keyword as below;

..
run_script()
    {
    TCL_sqoop_script.sh arguments
    }
...