And so too one who arrives from a distance during Chol HaMoed, for the matter is well-known. But from a nearby path – he is forbidden to shave, for not everyone knows. And even if he arrived from a distance on Erev Yom Tov before nightfall, but did not have time during the day to shave – he is permitted to shave during Chol HaMoed. And specifically when he did not have an inhabited place before Yom Tov, or even if he did, such as if he passed through inhabited places, but on Erev Yom Tov he did not have an inhabited place where he could shave. But if he had an inhabited place on Erev Yom Tov where he could have shaved – he is forbidden to shave during Chol HaMoed (Magen Avraham subsection 6). And so too specifically that he did not come on this journey of his from Eretz Yisrael to outside the Land for the sake of business, or to see the face of his friend, and certainly for a d'var mitzvah, but rather for a mere stroll. For regarding a mere stroll from Eretz Yisrael to outside the Land, they did not permit him to shave, for he should not have gone out for a mere stroll from Eretz Yisrael to outside the Land. But from outside the Land to Eretz Yisrael, or from Eretz Yisrael to Eretz Yisrael, or from outside the Land to outside the Land – even for a mere stroll he is permitted to shave. And so too these, even though they permitted them to shave, nevertheless they shall not shave themselves in public but rather in private, for perhaps there are those who do not know the matter, and they will come to treat shaving during Chol HaMoed with disrespect.
וכן הבא ממרחקים בחול המועד, שהדבר מפורסם. אבל מדרך קרובה – אסור לו לגלח, שאין הכל יודעים. ואפילו בא ממרחקים בערב יום טוב קודם הלילה, ולא היה לו שהות ביום לגלח – מותר לו לגלח בחול המועד. ודווקא כשלא היה לו מקום ישוב קודם יום טוב, או אפילו היה לו כגון שעבר דרך ישובים, אלא שבערב יום טוב לא היה לו מקום ישוב שהיה יכול לגלח. אבל היה לו מקום ישוב בערב יום טוב שהיה יכול לגלח – אסור לו לגלח בחול המועד (מגן אברהם סעיף קטן ו). וכן דווקא שלא בא בנסיעתו זאת מארץ ישראל לחוץ לארץ לשם עסק, או לראות פני חבירו, וכל שכן לדבר מצוה, אלא לטיול בעלמא. דבטיול בעלמא מארץ ישראל לחוץ לארץ לא התירו לו לגלח, שלא היה לו לצאת לטיול בעלמא מארץ ישראל לחוץ לארץ. אבל מחוץ לארץ לארץ ישראל, או מארץ ישראל לארץ ישראל, או מחוץ לארץ לחוץ לארץ – אפילו לטיול בעלמא מותר לו לגלח. וכן אלו אף שהתירו להם לגלח, מכל מקום לא יגלחו את עצמם בפרהסיא אלא בצינעא, דשמא יש שאינם יודעים העניין, ויבואו לזלזל בגילוח בחול המועד.