Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Aug 2025 08:17:45 -0400
From:      Richard M Kreuter <kreuter@progn.net>
To:        questions@freebsd.org
Subject:   Re: shebanged script not executed right - wth
Message-ID:  <38974.1754741865@ruk.vpn.home.arpa>
In-Reply-To: <N2fQGG8xsXO132Bf@aceecat.org>

index | next in thread | previous in thread | raw e-mail

fatty.merchandise677@aceecat.org writes:

> $ cat /opt/compat/python3
> #! /bin/sh
>
> exec /usr/local/bin/python3 "$@"
> $
<snip>
> $ head /opt/compat/relaymail
> #! /opt/compat/python3

I believe that on FreeBSD (and probably most Unices, historically), the
pathname after "#!" must resolve to an executable binary, i.e., an
interpreted program cannot serve as an #!-line interpreter.

Could you have /opt/compat/python3 be a symlink to
/usr/local/bin/python3?

> IS THIS A KERNEL BUG ???

Unices have never agreed exactly on #!-line behavior. Here's one
person's attempt to document differences:

https://www.in-ulm.de/~mascheck/various/shebang/

The relevant section for this thread is

https://www.in-ulm.de/~mascheck/various/shebang/#interpreter-script

Regards,
Richard


help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38974.1754741865>