I am making a script (for educational purposes) but I am kind of stuck here.. The program asks for an existing filename and checks if the filename actually exists. If it doesn't the loop repeats itself until you fill in a file that does exist. So far so good! But when you enter a filename that does exist I want the script to enter the next while loop, to enter the path file.. But it doesn't continue. How can I make enter the next while statement???
clear echo "Your filesystem is threatned, files should be moved in order to guarantee safety!!!!" while read FILE do if [ -f $FILE ]; then echo "File is safe to secure" else echo "Too late, we lost the file, safe another!" fi done echo "Time is running out, we must secure this file inmidiately, quick give me a safe location!" while read PATH do if [ -d $PATH ] && [ -f $FILE ]; then echo "the location is secure! Move the file!" else echo "Either the file or the safehouse is corrupt, quick try again!" fi done