Deuteronomy 23:9-14

Rules for the war camp

9 When you are camped in battle against your enemies, guard yourself from every possible evil.
10 If an individual in the camp becomes polluted due to a nighttime emission, he must exit the camp area and not reenter.
11 When the next evening arrives, he must wash with water; and when the sun sets, he can come back to the camp.
12 The latrines must be outside the camp. You will use them there, outside the camp.
13 Carry a shovel with the rest of your gear; once you have relieved yourself, use it to dig a hole, then refill it, covering your excrement.
14 Do these things because the LORD your God travels with you, right in the middle of your camp, ready to save you and to hand your enemies over to you. For this reason your camp must be holy. The LORD must not see anything indecent among you, or he will turn away from you.