we have the concept of ורבי היא, דאמר כל דבר שהוא משום שבות, לֹא גזרו עליו בין השמשות;. In narrowing the concept based on other gemarot, the Rambam writes:
והרמב"ם כתב בפ"ו מה' עירוב שכל דבר שהוא מדברי סופרים לא גזרו עליו בין השמשות במקום מצוה או בשעת הדחק ובפכ"ד מה' שבת כתב כל הדברים שהן אסורים משום שבות לא גזרו עליהן בין השמשות אלא בעצמו של יום הוא שהן אסורין אבל בין השמשות מותרין והוא שיהא שם דבר מצוה או דוחק כיצד מותר לו בין השמשות לעלות באילן או לשוט על פני המים להביא לולב או שופר וכן מוריד מן האילן או מוציא מן הכרמלית עירוב שעשה וכן אם היה טרוד ונחפז ונצרך לדבר שהוא משום שבות בין השמשות ה"ז מותר אבל אם לא היה שם דוחק ולא דבר מצוה אסור לפיכך אין מעשרין את הוודאי בין השמשות אע"פ שאיסור הפרשת מעשר בשבת משום שבות אבל מעשרין את הדמאי
The examples of shofar and lulav seem to be obscure - we wouldn't be using them anyway on Shabbat, so why does the Rambam use these as examples of mitzvot?
Simon, Modiin, Israel
1) The Teshuvos Avnei Yashfeh (5:98:1, page 233, paragraph beginning "v'Hishavti") writes that it seems that the Rambam is discussing a scenario where Rosh Hashanah fell on Friday and it is Bein ha'Shemashos but he has not yet heard the Shofar or not yet shaken the Lulav.
2) I found, bs'd, that the Pri Megadim writes the following in his introduction to Hilchos Yom Tov (2:1, end of #21, printed in the edition of vol. 1 of Shulchan Aruch Orach Chayim, in the standard editions):
"In #342 it is evident that in Bein ha'Shemashos of Motzai Shabbos, Shevus is also permitted."
#342 is the chapter in Shulchan Aruch, Orach Chayim, where the Rambam that we are discussing is cited.
We learn that the Pri Megadim understands that the Rambam is referring to a scenario where the first day of Yom Tov fell on Shabbos. At the end of Shabbos, during Bein ha'Shemashos, there is an opportunity to obtain a Shofar or Lulav for performing the Mitzvah the following morning, but a Rabbinical prohibition must be transgressed in order to get the Shofar or Lulav. This prohibition may be waived Bein ha'Shemashos in order to enable the Mitzvah to be carried out tomorrow.
3) Here are further sources:
a) In the Pri Megadim that I cited above, in addition to #342 he also refers us to Magen Avraham OC 623:4. There we are discussing blowing the Shofar at the end of Yom Kippur. The Magen Avraham writes that one may do so even though no stars have yet appeared in the sky. The Magen Avraham writes that this is permitted because it is Bein ha'Shemashos.
b) So we see another example of a Shevus involving the Shofar which is permitted Bein ha'Shemashos, again at the end of the day.
c) This is not quite the same as the Rambam's scenario, where he transgresses a Rabbinical prohibition in order to obtain a Shofar or Lulav, but the principle is similar -- that one may transgress a d'Rabanan in order to do a Mitzvah in the Bein ha'Shemashos period.
d) Here is a source in the Rashba:
The Mishnah Berurah (342:2 cites the Birkei Yosef who found a manuscript of the Rashba in Eruvin which says that Bein ha'Shemashos at the end of Shabbos is equivalent to Bein ha'Shemashos at the beginning of Shabbos.
These words now appear in the standard Chidushei ha'Rashba to Eruvin (end of 32b). He writes that according to Rebbi, there was also no Gezeirah made in Bein ha'Shemashos at the termination of Shabbos. There is no Gezeirah concerning Shevus either at the entrance of Shabbos or at the exit.
The Rashba is an independent opinion, of course, not dependent on the opinion of the Rambam, but we can now say that we have a support to what the Pri Megadim writes, that according to the Rambam no Gezeirah was made either at the beginning or at the end of Shabbos.
Therefore, we can say that the Rambam maintains that if the first day of Rosh Hashanah or of Sukos falls on Shabbos and one does not yet have a Shofar or Lulav, one may do an Isur d'Rabanan in order to obtain the item necessary for the Mitzvah the following day.
Yeyasher Kochacha,
Dovid Bloom