Thanks a lot for your solution.
I've checked it and it works ,but under specific circumstances:
The file in the configuration file must contain a full path.
My configuration file looks as the following:
The file does not contain its root directory. The root directory is entered during the running, as an input from the user.The root directory is a build area of jar,war,ear,tar and sql files, which belongs to a specific build version.
Therefore,the solution of vgersh99 is more suitable for me because i concatenate the root directory to the file name from the conf file.
I wrote the following function:
Finally,i chose your first solution:
while IFS=: read fileName yn
do
[ "${yn}" = "Y" ] && cp "${BUILD_DIR}/${fileName}" ${PRODUCTS_DIR}
done < "${configFile}"