Convert Bash script to C

dear all,

i need your advice for convert bash shell to C programming

INDEX=/zpool1/NFS/INDEX/${1}
SCRIPT=/zpool1/NFS/script/${1}
LIST=SAMPLE

cd ${SCRIPT}
for i in `cat ${LIST}`
do
GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'`
/usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >> "'${INDEX}/${GETDATE}/LIST_'"f".TCG"}' ${INDEX}/${i} #anumber
rm -f ${INDEX}/${i}
done
rm -f ${LIST}

can help me for convert above shell to c code and will same output like that ...and can run in linux base

thx before

It'd help if you explained what exactly it was supposed to do...

@corona688:thx for comment
like this i have input big file file:
SAMPLE

1:name_of_file:12345:345
2:name_of_file:56789:789

so i need print delimiter $4 (345 and 789) for will substitution to file like this
INDEX_345.TXT

1:name_of_file:12345:345

INDEX_789.TXT

2:name_of_file:56789:789