Don't need the rm -f statement when using > redirect to overwrite thefile, and add the "then" to the if statements
Don't need the rm -f statement when using > redirect to overwrite the
file, and add the "then" to the if statements