Add while loop to bash