לֹא תְבַעֲרוּ אֵשׁ בְּכֹל משְׁבֹתֵיכֶם בְּיוֹם הַשַּׁבָּת
(שמות לה:ג)
The Gemara in Shabbos (69b) discusses a predicament of someone stranded in the desert who doesn’t know what day it is. The Gemara’s problem is what should he do concerning Shabbos: Does he have to keep Shabbos at all or not? And, if so, when?
The Rambam (Hilchos Shabbos 2:22) writes the halachic conclusion of this Gemara: “A person who is traveling in the desert and does not know which day is Shabbos should count six days and consider the seventh day as kadosh (holy). He recites Kiddush, and recites Havdalah at the conclusion of this day of ‘Shabbos.’ Every day—even on the day on which he recites Kiddush and after which he recites Havdalah—he is allowed to earn only enough for his livelihood, so that he will not die … ”
In other words, there are three halachos concerning someone who doesn’t know the day of the week. Firstly, since there is a possibility that any given day is Shabbos, he can never do more melachos (work) than he needs to survive. Secondly, he counts six days from the day he realizes he doesn’t know what day it is and on the next day—the seventh day—he makes Kiddush and Havdalah as if it was Shabbos. Thirdly, even on that day that he designated to be Shabbos, he is only allowed to do melachos that he needs to survive.
Although the Gemara doesn’t give any source for this ruling, Zera Shimshon writes two allusions to this halacha in the Torah!
The first one Zera Shimshon mentions is the pasuk in our parsha (Shemos 35:3), “Lo sevaaru aish bechol moshvosaichem beyom haShabbos—You shall not kindle a fire in any of your dwelling places on Shabbos.” Seemingly the phrase “bechol moshvosaichem—in any of your dwelling places” is extra? It is written in the mishna in Kiddushin that only mitzvos that are dependent on the land, like separating terumah and maaser apply only to Eretz Yisroel. All other mitzvos apply everywhere! Why then does the Torah stress here—regarding the prohibition of making a fire on Shabbos—that it also applies everywhere? Why would you think differently?
Zera Shimshon explains this phrase alludes to the above halacha, “Only in your dwelling places, when you are not in the desert and you know what day is Shabbos, one may not kindle a fire.” However, if one is in the desert, and does not know what day of the week it is, he is allowed to kindle a fire, even though on that day he makes Kiddush and Havdalah as if it was Shabbos!
The second allusion to this halacha is in the 10 commandments. It is written there, “Shaishes yamim taavod veasisa kol melachtecha. Vayom hashevii Shabbos laHashem Elokecha lo saaseh kol melacha … —Six days you may work and perform all your labor. But the seventh day is Shabbos to Hashem, your Lord, you are prohibited to do any melacha …” It would seem that there is no mitzvah to work six days and therefore, the first pasuk, “Shaishes yamim taavod veasisa kol melachtecha,” is extra and not teaching anything. Why then did the Torah write it?
Zera Shimshon explains that it is a preface to the next pasuk—that one must rest and not do any melachos on Shabbos and is alluding to our halacha; in a situation when, “Six days you may work and perform all your labor … then the seventh day is Shabbos to Hashem, your Lord; you shall perform no labor.”
However, when six days you may not work and perform all of your labor—like a person in the desert that can only do melachos that are needed for his survival—then on Shabbos, he is not prohibited from doing all melachos, but he is permitted to do melachos that are needed for him to stay alive.
In summary, Zera Shimshon quotes the Rambam’s psak that a person lost in the desert and doesn’t know what day it is, can only do melachos that is needed for him to stay alive. He makes Kiddush and Havdalah every seven days, starting on the seventh day after he realizes that he doesn’t know the day of the week and on that day that he designated to be Shabbos, he is also only permitted to do melachos to survive.
Zera Shimshon cites two allusions to this halacha; one from the pasuk, “Lo sevaaru aish bechol moshvosaichem beyom haShabbos—You shall not kindle a fire in any of your dwelling places on Shabbos,” as written in our parsha, and the other one is pesukim in the 10 commandments, “Shaishes yamim taavod veasisa kol melachtecha. Vayom hashevii Shabbos laHashem Elokecha lo saaseh kol melacha—Six days you may work and perform all your labor. But the seventh day is Shabbos to Hashem, your Lord, you are prohibited to do any melacha … ”