Thread (11 messages) 11 messages, 6 authors, 2024-01-04

Re: [PATCH v2 net-next] selftests/net: change shebang to bash to support "source"

From: Yujie Liu <hidden>
Date: 2024-01-02 05:56:26
Also in: linux-kselftest, lkml

On Sun, Dec 31, 2023 at 01:17:11PM +0100, Guillaume Nault wrote:
On Fri, Dec 29, 2023 at 09:19:31PM +0800, Yujie Liu wrote:
quoted
The patch set [1] added a general lib.sh in net selftests, and converted
several test scripts to source the lib.sh.

unicast_extensions.sh (converted in [1]) and pmtu.sh (converted in [2])
have a /bin/sh shebang which may point to various shells in different
distributions, but "source" is only available in some of them. For
example, "source" is a built-it function in bash, but it cannot be
used in dash.

Refer to other scripts that were converted together, simply change the
shebang to bash to fix the following issues when the default /bin/sh
points to other shells.
Looks like it'd be simpler to just replace the "source" commands with
"." and leave the shebang as is (unless there are other bash-specific
constructs in these scripts of course).

Generally speaking, I think we should avoid madating a specific shell,
unless that really simplifies the test script (which is not the case
here).
Hi Guillaume,

Thanks for the comments. As this is related with a large patch series from
Hangbin, and other scripts use "source" during the conversion, so we may
need some input from Hangbin.

Hi Hangbin,

Could you please share your comments on this? Would you like to replace
"source" with "." for these two specific scripts as Guillaume suggested,
or change the shebang from "sh" to "bash"?

Best Regards,
Yujie
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help