如何使用shell脚本循环遍历多个文件?

时间:2015-09-10 03:40:05

标签: bash shell

我有多个文件,其格式为:1s_l2b_2008031.nc;例如:db.collection.update({attribute: null}, {$set:{"attribute":value}})

我正在尝试使用shell脚本从远程服务器下载这些文件,但遗憾的是我无法找到这样做的方法。由于我的理解有限,代码应该循环多年作为外部循环并循环几天作为内部循环。核心代码应该使用scp从服务器下载文件。我已经想出如何使用scp下载其中一个文件,但需要一些帮助来解决“for循环”问题。

年份是从1999年到2009年。日期是从001到365

1 个答案:

答案 0 :(得分:0)

您可以使用通配符来scp多个文件,如

scp user@somehost:/some/path/to/files/qs_l2b_*.nc /some/target/directory/
相关问题