Thanksgiving in Halacha

(ג) כְּמַעֲשֵׂה אֶרֶץ מִצְרַיִם אֲשֶׁר יְשַׁבְתֶּם בָּהּ לֹא תַעֲשׂוּ וּכְמַעֲשֵׂה אֶרֶץ כְּנַעַן אֲשֶׁר אֲנִי מֵבִיא אֶתְכֶם שָׁמָּה לֹא תַעֲשׂוּ וּבְחֻקֹּתֵיהֶם לֹא תֵלֵכוּ.

(3) Like the practice of the land of Egypt, where you dwelt, you shall not do; and after the doings of the land of Canaan, where I bring you, you shall not do; neither shall you walk in their statutes.

(א) אין הולכין בחקות העובדי כוכבים ולא מדמין להן לא במלבוש ולא בשער וכיוצא בהן שנאמר ולא תלכו בחקות הגוים ונאמר ובחקותיהם לא תלכו

לכך פירש ר"י דתרי גווני חוקה הוו אחד שעושין לשם חוק לעבודת כוכבים ואחד שעושין לשם דעת הבל ושטות שלהם

Maharik Section 48

לע"ד נראה דדבר (א) פשוט דלא לאסור משום חק אלא בא' משני חלקים האחד הוא הדבר אשר אין טעמו

נגלה כדמשמע לשון חק

הגה: אלא יהא מובדל מהם במלבושיו ובשאר מעשיו (שם). וכל זה אינו אסור אלא בדבר שנהגו בו העובדי כוכבים לשום פריצות, כגון שנהגו ללבוש מלבושים אדומים, והוא מלבוש שרים וכדומה לזה ממלבושי הפריצות, או בדבר שנהגו למנהג ולחוק ואין טעם בדבר דאיכא למיחש ביה משום דרכי האמורי ושיש בו שמץ עבודת כוכבים מאבותיהם, אבל דבר שנהגו לתועלת, כגון שדרכן שכל מי שהוא רופא מומחה יש לו מלבוש מיוחד שניכר בו שהוא רופא אומן, מותר ללובשו. וכן שעושין משום כבוד או טעם אחר, מותר (מהרי"ק שורש פ"ח)

RAMA: Rather, one [i.e., a Jew] should be distinct from them [i.e., non-Jews] in one’s manner of dress and in all of one’s actions. But all of this [i.e., these restrictions] apply only to things that non-Jews do for the sake of licentiousness. For example, they are accustomed to wearing red clothing, which is official/princely clothing, and other clothing that is similarly immodest. [These restrictions also apply] to things that they are accustomed to doing because of a custom or rule that does not have a[ny underlying] reason, out of concern that [a Jew who does such things will follow the] “ways of the Amorites,” and that it has the blemish of [i.e., is tainted by] idol worship inherited from their ancestors. But things that they are accustomed to doing for a useful purpose—such as their custom for expert doctors to wear particular clothing so that the doctors will be recognized as specialists—one is permitted to wear [such clothing]. Similarly, things that are done out of respect or another reason, it is permitted [for one to do such things]. And therefore they said one may burn [the items of deceased] kings, and there is not in this “the ways of the Amorites.”