git: d3890a547d20 - main - sh: when loading profile, skip obvious scratch files.

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Mon, 03 Oct 2022 14:36:01 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=d3890a547d201d1f5043e51baa406ac9d5d3a60a

commit d3890a547d201d1f5043e51baa406ac9d5d3a60a
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2022-10-02 12:23:28 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2022-10-03 14:35:51 +0000

    sh: when loading profile, skip obvious scratch files.
    
    Differential Revision: https://reviews.freebsd.org/D36856
---
 bin/sh/profile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/sh/profile b/bin/sh/profile
index afcbeaf4110b..ac6acced6596 100644
--- a/bin/sh/profile
+++ b/bin/sh/profile
@@ -19,6 +19,11 @@ _loaded=${_loaded:-/etc/profile}
 export _loaded
 for _dir in /etc /usr/local/etc ; do
 	for _file in "${_dir}"/profile "${_dir}"/profile.d/* ; do
+		case ${_file} in
+		*[~#]|*.OLD|*.bak|*.orig|*,v)
+			continue
+			;;
+		esac
 		if [ -f "${_file}" ] ; then
 			case :${_loaded}: in
 			*:"${_file}":*)