意外';(';在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))