I was doing something like the following minimal example:
#! /bin/sh
# $1 = file containing list of files to sync
# $2 = source dir ; $3 = target dir
cat "$1" | while read f
do
cp -i "$2"/"$f" "$3"/"$f"
done
I find that cp -i doesn't wait for my input at all and the loop just runs to the end. Why, and what can be done to fix the situation?