Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
意外';(';在bash中)_Bash - Fatal编程技术网

意外';(';在bash中)

意外';(';在bash中),bash,Bash,我有以下脚本: #!/bin/sh # Use the PhiPack software on our two aligned sets of sequences... mkdir FcFeABC cd FcFeABC ../bin/PhiPack/Phi -f ../../Data/Real_Sequences_and_Networks/FcFeABC_alignment.fas -o -v -w 10 -g cd - mkdir FcL10 cd FcL10 ../bin/PhiPack

我有以下脚本:

#!/bin/sh

# Use the PhiPack software on our two aligned sets of sequences...
mkdir FcFeABC
cd FcFeABC
../bin/PhiPack/Phi -f ../../Data/Real_Sequences_and_Networks/FcFeABC_alignment.fas -o -v -w 10 -g
cd -

mkdir FcL10
cd FcL10
../bin/PhiPack/Phi -f ../../Data/Real_Sequences_and_Networks/FcL10_alignment.fas -o -v -w 10 -g
cd -

# Use the PhiPack software on the simulated Datasets...
cd ../Data/Simulated_Sequences_and_Networks/Constant_Sex/Theta\ =\ 0.066/Theta\ =\ 0.066/Medium/CutSequences/;
rmus=($(ls -d *.fas))
cd -
absfiles=(../Data/Simulated_Sequences_and_Networks/Constant_Sex/Theta\ =\ 0.066/Theta\ =\ 0.066/Medium/CutSequences/*.fas)
if [ ${#rmus[@]} = ${#absfiles[@]} ]
then
    mkdir ${rmus[@]}
    for ((i=0; i<${#absfiles[@]}; i++));
    do
        cd ${rmus[$i]}
    .../bin/PhiPack/Phi -f ${absfiles[$i]} -o -v -w 10 -g
        cd -
    done
else
    echo "Error, Number of files created and files to be read differs"
fi
这是哪一行:

rmus=($(ls -d *.fas))
我不明白为什么“(”是意外的-它只是将ls的结果分配给一个数组

谢谢,
Ben W.

您不是在用
bash
运行它。您是在用您的shebang行
#!/bin/sh
中的
/bin/sh
运行它

使用
bash
显式运行
bash runPhiTests.sh
或修复您的shebang行
#!/bin/bash
尝试使用#!/bin/bash代替sh。

#!/bin/sh
应该是
#!/bin/bash
rmus=($(ls -d *.fas))