Ok, here is the problem. Im writing a script/progran in/for linux and unix at work that will speed up the install processes for all of our Linux/Unix installs. I have a small segment of code that i cannot get to work and i cannot figure out why. First ill explain what it is supposed to do. Basically the user will already have put a specific cd into the cd-rom and the script will try to mount it. If linux cannot mount the cd, then it will prompt the user to insert the cd and eject the cdrom (and then hit enter). After the user hits enter the "continue" is supposed to bring the script back to the beginning of the loop... but it doesnt. Instead it continues executing all of the commands throughout the rest of the loop. This may be an easy problem but i fail to see why it doesnt work. If someone could help that would help me greatly because im really hung up on this point. I know several ways to get around this so you need not post a way to work around it, im interested in finding out why this didnt work exactly. If im lacking information or anything to that affect tell me and ill gladly post more. Thanks a ton if you can help!



loop2=y
while [ $loop2 = y ]
do

umount /mnt/cdrom 2> /dev/null
echo
echo Mounting cdrom...
echo "*note: If a window pops up when the cd is mounted you may close it."
echo

## THIS IS THE PART THAT DOESNT WORK
mount /mnt/cdrom 2> /dev/null && loop2=n || ( echo The cd did not mount properly. Please ensure that the ServeRAID Manager && echo -n "cd is inserted and hit enter: " && eject /mnt/cdrom && ( read blank ; continue ) ) 2> /dev/null
##
echo

echo Installing ServeRAID Manager....
rpm --install /mnt/cdrom/linux/manager/RaidMan-4.84.i386.rpm 2> /dev/null

echo Copying ipssend to /usr/bin and changing permissions to 777....
cp /mnt/cdrom/linux/cmdline/ipssend /usr/bin 2> /dev/null
chmod 777 /usr/bin/ipssend
echo
umount /mnt/cdrom 2> /dev/null
echo Installation of ServeRAID is now complete. You may remove the cd.
done


--Morphman
PS: This is the bash