shell - Replacing the file name in a loop in param file passed to pmcmd -


i have many filenames listed in text file, in each line(file_name) extracted , passed pmcmd. param file has specific format consisting global parameters such username, password, domain, filename etc. problem how change file name in loop passed pmcmd , triggers wf load data each file listed in text file

here sample script

while ifs= read -r var_filename;     if [ $p_count -ne 0 ]         param_file_name=param_file.txt     out_param=/infa_pmroot/infa_shared/epi/scripts/claims_dev/test_nv/$param_file_name     if [ -f $out_param ];  rm -f $out_param; fi;     echo $var_filename > $param_file_name     echo started executing workflow $var_filename     pmcmd startworkflow -sv $integration_services -d $domain -usd $ldap -u $username -p $password -f $folder -wait wf_workflow_name >>$logfile 2>>$logfile     else      echo check count of records in processed_file_details_log $var_table_name "$var_table_name"_full_file_list.txt     fi     done < $3"_to_be_processed_file_list.txt" fi 

in session, put $inputfilename source file name. inside loop append parameter param file:

echo "[global]"> $param_file_name echo "\$inputfilename=$var_filename" >> $param_file_name 

and pass parameter file path pmcmd

pmcmd startworkflow -sv $integration_services -d $domain -usd $ldap -u $username -p $password -f $folder -paramfile $param_file_name -wait wf_workflow_name >>$logfile 2>>$logfile 

Comments