我想在bash脚本中使用WGET下载一些文件。每个图像都在许多可用子目录之一中。我可以使用WGET通过按名称列出每个子目录来进行筛选。但是,有太多子目录,我想找到一种方法让WGET搜索所有子目录而不列出它们(示例为20150125_028445 20150125_028450 20150126_028454,但还有更多)。我该怎么做呢?这是我当前的代码:
declare -a image=("lor_0299176871_0x636_sci.fit" "lor_0299176907_0x636_sci.fit" "lor_0299176943_0x636_sci.fit")
address='https://pds-smallbodies.astro.umd.edu/holdings/nh-p-lorri-3-pluto-v2.0/data/'
possibilities=( 20150125_028445 20150125_028450 20150126_028454 )
for file in "${image[@]}"
do
for possibility in "${possibilities[@]}"
do
wget "$address$possibility/$file" && break
done
done