Fixed until loop and added important comments about I/O redirection used in the script