From 54637e7ee14c40d2cae595b73af8969b280e3ce3 Mon Sep 17 00:00:00 2001 From: John Hein Date: Nov 22 2023 05:38:59 +0000 Subject: Ensure csh syntax is used for C shell even if SHELL env var is unset. We know we're running from C shell in perl-homedir.csh, so be explicit rather than letting local::lib guess. If the SHELL environment variable is not set, perl -Mlocal::lib is fooled into emitting bourne shell syntax (e.g., export FOO=bar) instead of csh syntax (setenv FOO bar). This can be fatal to the C shell possibly interrupting execution of a script before the script has completed. This (no SHELL variable set) can happen, for instance, when running a cron job. See also: https://bugzilla.redhat.com/show_bug.cgi?id=2122359 https://issues.redhat.com/browse/RHEL-5545 Signed-off-by: John Hein --- diff --git a/perl-homedir.csh b/perl-homedir.csh index eaacb37..1c7dc49 100644 --- a/perl-homedir.csh +++ b/perl-homedir.csh @@ -11,10 +11,10 @@ if (-f "$HOME/.perl-homedir") then eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' "$HOME/.perl-homedir"` endif -alias perlll 'eval "`perl -Mlocal::lib`"' +alias perlll 'eval "`env SHELL=csh perl -Mlocal::lib`"' # if system default if ("x$PERL_HOMEDIR" == "x1") then - eval "`perl -Mlocal::lib`" + eval "`env SHELL=csh perl -Mlocal::lib`" endif