Quote:
if test -f /u/ttc/
then #File or directory exists so ask for confirmation
echo -n "Ready to begin copy, continue? [y/n]"; read choice
if [ "$choice" -eq y ] || [ "$choice" -eq Y]; then echo "Copying files"
cp -r $livecomp $copycomp
mv -r $livecomp $tempcomp
if [ test -f /u/ttc/ ]
then
echo "Ready to begin copy, continue? [y/n]" ; read choice
if [ "$choice" -eq y ] || [ "$choice" -eq Y]
then
DIR_COUNT=`wc -l /u/ttc/`
TOTAL=$DIR_COUNT
echo "Directory Count is ${DIR_COUNT}. Begining Copy"
while [ $DIR_COUNT -gt 0 ]
do
echo " Copying file $DIR_COUNT of $TOTAL"
cp -r $livecomp $copycomp
mv -r $livecomp $tempcomp
let DIR_COUNT=$DIR_COUNT-1
done
Check syntax as I just quickly typed this out..there are better ways to do this, this is just to give you an idea of how to go about implementing your fix. You may also want to invest in some error checking following the copy command (unless of course you are running as root). Also, you may want to change the -eq to = since you are comparing a string an not an integer. Another point would be to log the events in your script (which Im sure you are doing
)