gpt4 book ai didi

bash - 我得到 'syntax error: "("unexpected'(期望 "done")

转载 作者:行者123 更新时间:2023-11-29 09:01:32 24 4
gpt4 key购买 nike

<分区>

我有一个非常简单的 shell 脚本,我用它来遍历目录,并调用另一个 shell 脚本。我在我的本地机器上编写它(OS X 运行 Bash 3.2)并在运行 Bash 4.2 的远程服务器上使用它。

在服务器上,当我键入 which bash 时,我得到 /bin/bash,所以我在顶部添加了这一行。我仍然收到此错误,指向以 arrIN=...

开头的行

8: run_all_verification.sh: Syntax error: "(" unexpected (expecting "done")

shell脚本:

#!/usr/bin/bash

# Base name for all experiments
BASE_EXP_ID=$1;

for i in ${BASE_EXP_ID}*
do
# Split file name by "__"
arrIN=(${i//__/ });
EXP_ID=${arrIN[0]}
NUM_FEATURES=${arrIN[1]}
echo "${EXP_ID} ${NUM_FEATURES}"

sh run_verification.sh ${EXP_ID} ${NUM_FEATURES}

done

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