Here File1 is the template. File2 is a csv with 200 rows with the columns scriptname ,jobname, templatename, locationThe templatename is column with in the file2.Is it possible to do it as below. The purpose is to use different templates (file1's) for different rows in file2. Any help is appreciated $templatename I want to change with rows of flie 2. Is it possible? The following is not working:samplefile1scriptnamestatments go herechange jobnamesave in the location folder (already there)sample file2scriptname, jobname, templatename, locationqqqtest,sew-test,/san00/test/file1, /san00/test/qqqtest,sew-test,/san00/test/file2, /san00/test/What I am expecting is to change the file1, file2 templates etc. each time with the below update by reading csv?while IFS=, read scriptname jobname templatename location; do sed -e s/scriptname/$scriptname/ \  -e s/jobname/$jobname/ $templatename > $location done < (file2) How I update the $templatename? 
passing file as a parameter with sed and loop
shell;shell script