I've recently wrote a manpage, which display properly in bash shell. However, in zsh the man return an error message: /bin/zsh: can't open input file: man. Is there a difference in man syntax between zsh and bash? Below is an shorten example.
.\" Manpage for func.
.TH func 1 "08 Nov 2022" "1.0" "func man page"
.SH NAME
\fBfunc\fR - short desc.
.SH SYNOPSIS
\fBfunc\fR [\fB-h\fR] [\fB-D\fR \fIpath/to/destination\fR]
.SH DESCRIPTION
\fBiid_query.sh\fsome # more '\fIabc\fR'. other '\fI_abc\fR' continue name\*(lq\fI./abc\fR\*(rq.
.br
.B " some other"
.SH OPTIONS
\fB-D\fR \fIpath/to/destination\fR
.br
The path of the destination directory.
.LP
\fB-h\fR
.br
Display the usage.
.SH BUGS
No known bugs.
.SH AUTHOR
Someone
———————— Update ————————
The man page is stored within the project repo, the problem occurs when checking if the doc generated display properly. The repo tree is like below:
parent
|
+———— src
| |
| +—— func
|
+———— man
|
+—— func # manpage for func
The page is check by
man $ man ./func
In macOS 12 terminal (/bin/bash) and the ubuntu running as Win-subsystem (/bin/bash) the page can be display properly (tested on different machine). However, in macOS 13 terminal (/bin/zsh) the file cannot be opened by man. Current consideration is either macOS 13 contain a different version of man, or it is due to the change in zsh.
———————— Update ————————
$ mandoc -Tpdf "$(man -w ./func)"
produce properly formatted pdf.
Moreover, on the macOS 13 running zsh, man -V or man --version given an error. However, man for build-in command is working properly.
./man1/foo.1, and then runMANPATH=. man foo, it displays fine.manis not a shell internal command. How could then the invocation syntax be different? You did not write how you invoked themanin your case, where you have stored the man-page, and how you have setMANPATH, so I don't think one can point out the error.manis the same command no matter which shell starts it (at least, it is so long as bash'stype manand zsh'swhich manpoint to the same place)./usr/bin/man ./funcexplicitly if you want to prevent any aliases or function wrappers from getting in the way?