Subject: 30.0.93; man.el assume shell is bash

From: Ted Phelps <[email-masked]>
Date: Fri, 03 Jan 2025 09:39:09 +1000

Steps to reproduce:
* env SHELL=/bin/tcsh emacs -Q
* invoke M-x man
* request a man page (e.g. emacs)

This will produce output like the following instead of the man page:

    Unmatched '''.
    BEGIN: Command not found.
    anonblank=0: Command not found.
    }: Command not found.
    Illegal variable name.
    {: Command not found.
    }: Command not found.
    Illegal variable name.
    Badly placed ()'s.
    Unmatched '''.

    process exited abnormally with code 1

Replacing /bin/tcsh with /bin/bash in the above command produces the
expected man page.

It looks like the behavior was broken by the following commit:

    commit 861ac933dd8aed1028edc4b9142400e3702874d5
    Author: Michael Albinus <[email-masked]>
    Date:   Wed Nov 1 16:54:31 2023 +0100

Many thanks,
-Ted

In GNU Emacs 30.0.93 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-12-20 built on hades
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --enable-link-time-optimization
 --prefix=/usr/local/stow/emacs-30.0.93 'CFLAGS=-g3 -Wall -O3 -pipe'
 --with-pgtk --with-native-compilation=aot
 --enable-locallisppath=/usr/share/emacs/site-lisp'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  global-auto-revert-mode: t
  editorconfig-mode: t
  delete-selection-mode: t
  server-mode: t
  global-quilt-mode: t
  quilt-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash hides /usr/share/emacs/site-lisp/elpa/dash-2.19.1/dash
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-pkg hides /usr/share/emacs/site-lisp/elpa/dash-2.19.1/dash-pkg
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-autoloads hides /usr/share/emacs/site-lisp/elpa/dash-2.19.1/dash-autoloads
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit hides /usr/share/emacs/site-lisp/elpa/git-commit-3.3.0/git-commit
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit-pkg hides /usr/share/emacs/site-lisp/elpa/git-commit-3.3.0/git-commit-pkg
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit-autoloads hides /usr/share/emacs/site-lisp/elpa/git-commit-3.3.0/git-commit-autoloads
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-section hides /usr/share/emacs/site-lisp/elpa/magit-section-3.3.0/magit-section
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor hides /usr/share/emacs/site-lisp/elpa/with-editor-3.0.5/with-editor
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor-pkg hides /usr/share/emacs/site-lisp/elpa/with-editor-3.0.5/with-editor-pkg
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor-autoloads hides /usr/share/emacs/site-lisp/elpa/with-editor-3.0.5/with-editor-autoloads
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-autoloads hides /usr/share/emacs/site-lisp/elpa-src/dash-2.19.1/dash-autoloads
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash hides /usr/share/emacs/site-lisp/elpa-src/dash-2.19.1/dash
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-pkg hides /usr/share/emacs/site-lisp/elpa-src/dash-2.19.1/dash-pkg
/usr/share/emacs/site-lisp/elpa/epl-0.9/epl-autoloads hides /usr/share/emacs/site-lisp/elpa-src/epl-0.9/epl-autoloads
/usr/share/emacs/site-lisp/elpa/epl-0.9/epl hides /usr/share/emacs/site-lisp/elpa-src/epl-0.9/epl
/usr/share/emacs/site-lisp/elpa/epl-0.9/epl-pkg hides /usr/share/emacs/site-lisp/elpa-src/epl-0.9/epl-pkg
/usr/share/emacs/site-lisp/elpa/flycheck-32snapshot/flycheck-autoloads hides /usr/share/emacs/site-lisp/elpa-src/flycheck-32snapshot/flycheck-autoloads
/usr/share/emacs/site-lisp/elpa/flycheck-32snapshot/flycheck hides /usr/share/emacs/site-lisp/elpa-src/flycheck-32snapshot/flycheck
/usr/share/emacs/site-lisp/elpa/flycheck-32snapshot/flycheck-pkg hides /usr/share/emacs/site-lisp/elpa-src/flycheck-32snapshot/flycheck-pkg
/usr/share/emacs/site-lisp/elpa/flycheck-32snapshot/flycheck-ert hides /usr/share/emacs/site-lisp/elpa-src/flycheck-32snapshot/flycheck-ert
/usr/share/emacs/site-lisp/elpa/flycheck-32snapshot/flycheck-buttercup hides /usr/share/emacs/site-lisp/elpa-src/flycheck-32snapshot/flycheck-buttercup
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit-autoloads hides /usr/share/emacs/site-lisp/elpa-src/git-commit-3.3.0/git-commit-autoloads
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit hides /usr/share/emacs/site-lisp/elpa-src/git-commit-3.3.0/git-commit
/usr/share/emacs/site-lisp/elpa/git-commit-2.99.0/git-commit-pkg hides /usr/share/emacs/site-lisp/elpa-src/git-commit-3.3.0/git-commit-pkg
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist-autoloads hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist-autoloads
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist-pkg hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist-pkg
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/git-rebase hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/git-rebase
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-worktree hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-worktree
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-wip hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-wip
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-utils hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-utils
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-transient hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-transient
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-tag hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-tag
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-subtree hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-subtree
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-submodule hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-submodule
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-status hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-status
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-stash hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-stash
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-sequence hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-sequence
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-section hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-section
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-reset hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-reset
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-repos hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-repos
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-remote hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-remote
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-refs hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-refs
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-reflog hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-reflog
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-push hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-push
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-pull hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-pull
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-process hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-process
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-pkg hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-pkg
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-patch hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-patch
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-obsolete hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-obsolete
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-notes hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-notes
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-mode hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-mode
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-merge hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-merge
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-margin hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-margin
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-log hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-log
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-imenu hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-imenu
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-gitignore hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-gitignore
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-git hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-git
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-files hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-files
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-fetch hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-fetch
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-extras hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-extras
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-ediff hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-ediff
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-diff hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-diff
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-core hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-core
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-commit hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-commit
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-clone hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-clone
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-branch hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-branch
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-bookmark hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-bookmark
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-blame hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-blame
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-bisect hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-bisect
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-autorevert hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-autorevert
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-autoloads hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-autoloads
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-apply hides /usr/share/emacs/site-lisp/elpa-src/magit-3.3.0/magit-apply
/usr/share/emacs/site-lisp/elpa/magit-section-3.3.0/magit-section-autoloads hides /usr/share/emacs/site-lisp/elpa-src/magit-section-3.3.0/magit-section-autoloads
/usr/share/emacs/site-lisp/elpa/magit-3.3.0/magit-section hides /usr/share/emacs/site-lisp/elpa-src/magit-section-3.3.0/magit-section
/usr/share/emacs/site-lisp/elpa/magit-section-3.3.0/magit-section-pkg hides /usr/share/emacs/site-lisp/elpa-src/magit-section-3.3.0/magit-section-pkg
/usr/share/emacs/site-lisp/elpa/pkg-info-0.6/pkg-info-autoloads hides /usr/share/emacs/site-lisp/elpa-src/pkg-info-0.6/pkg-info-autoloads
/usr/share/emacs/site-lisp/elpa/pkg-info-0.6/pkg-info hides /usr/share/emacs/site-lisp/elpa-src/pkg-info-0.6/pkg-info
/usr/share/emacs/site-lisp/elpa/pkg-info-0.6/pkg-info-pkg hides /usr/share/emacs/site-lisp/elpa-src/pkg-info-0.6/pkg-info-pkg
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq-24 hides /usr/share/emacs/site-lisp/elpa-src/seq-2.23/seq-24
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq hides /usr/share/emacs/site-lisp/elpa-src/seq-2.23/seq
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq-pkg hides /usr/share/emacs/site-lisp/elpa-src/seq-2.23/seq-pkg
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq-autoloads hides /usr/share/emacs/site-lisp/elpa-src/seq-2.23/seq-autoloads
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq-25 hides /usr/share/emacs/site-lisp/elpa-src/seq-2.23/seq-25
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor-autoloads hides /usr/share/emacs/site-lisp/elpa-src/with-editor-3.0.5/with-editor-autoloads
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor hides /usr/share/emacs/site-lisp/elpa-src/with-editor-3.0.5/with-editor
/usr/share/emacs/site-lisp/elpa/with-editor-3.0.2/with-editor-pkg hides /usr/share/emacs/site-lisp/elpa-src/with-editor-3.0.5/with-editor-pkg
/usr/share/emacs/site-lisp/elpa/transient-0.2.0.30/transient hides /usr/local/stow/emacs-30.0.93/share/emacs/30.0.93/lisp/transient
~/env/emacs/csharp-mode hides /usr/local/stow/emacs-30.0.93/share/emacs/30.0.93/lisp/progmodes/csharp-mode
~/env/emacs/bat-mode hides /usr/local/stow/emacs-30.0.93/share/emacs/30.0.93/lisp/progmodes/bat-mode
/usr/share/emacs/site-lisp/elpa/seq-2.23/seq hides /usr/local/stow/emacs-30.0.93/share/emacs/30.0.93/lisp/emacs-lisp/seq
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /usr/local/stow/emacs-30.0.93/share/emacs/30.0.93/lisp/emacs-lisp/let-alist

Features:
(shadow mail-extr emacsbug message yank-media puny rfc822 mml mml-sec
epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pp sql
calc-misc calc-ext pgen calc calc-loaddefs rect calc-macs autorevert
tramp-cmds tramp-cache time-stamp tramp-sh tramp trampver
tramp-integration tramp-message tramp-compat xdg format-spec
tramp-loaddefs diff-mode track-changes cus-start cus-load editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch
display-line-numbers ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util doc-view filenotify image-mode exif
sh-script smie executable cmake-ts-mode asm-mode ffap make-mode shell
pcomplete files-x grep etags fileloop generator xref project rust-mode
macros kmacro rust-ts-mode c-ts-common treesit parse-time iso8601
mule-util info thingatpt debug backtrace find-func shortdoc cl-print
help-fns radix-tree tar-mode arc-mode archive-mode cc-mode cc-fonts
cc-guess cc-menus cc-cmds dired-aux dired dired-loaddefs misearch
multi-isearch comp comp-cstr cl-extra warnings jka-compr woman tabify
imenu man time-date hanoi view sort disp-table tetris gamegrid help-mode
apropos compile text-property-search comint ansi-osc ansi-color ring
comp-run comp-common rx compilestuff advice appt diary-lib
diary-loaddefs cal-menu calendar cal-loaddefs delsel server mh-e
mh-buffers mh-loaddefs quilt easy-mmode cc-styles cc-align cc-engine
cc-vars cc-defs package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs icons password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen
pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk multi-tty move-toolbar
make-network-process native-compile emacs)

Memory information:
((conses 16 676005 179979) (symbols 48 25996 0)
 (strings 32 97564 6007) (string-bytes 1 3445019) (vectors 16 40935)
 (vector-slots 8 563483 51609) (floats 8 195 9179)
 (intervals 56 55949 910) (buffers 992 128))