我有 32 个文件(以相同的模式命名,唯一的区别是下面写的 $sample 编号),我想将它们分成 4 个文件夹。我正在尝试使用以下脚本来完成这项工作,但该脚本无法正常工作,有人可以帮我使用以下 shell 脚本吗?- 谢谢
#!/bin/bash
max=8 #8 files in each sub folder
numberFolder=4
sample=0
while ($numberFolder > 1) #skip the current folder, as 8 files will remain
do
for (i=1; i<9; i++)
do
$sample= $i * $numberFolder # this distinguish one sample file from another
echo "tophat_"$sample"_ACTTGA_L003_R1_001" //just an echo test, if works, will replace it with "cp".
done
$numberFolder--
end