gpt4 book ai didi

bash - 函数名在 bash 中有效但在 sh 中无效

转载 作者:行者123 更新时间:2023-11-29 08:53:13 24 4
gpt4 key购买 nike

<分区>

在使用 bash 和 sh 时,我发现以下内容在 bash 中有效:

system.out.println () { printf "$1"; }

但不在 sh 中:

sh: `system.out.println': not a valid identifier

为什么会有这种差异?上面定义的函数是否违反了导致此错误的某些约定(POSIX 等)?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com