#!/bin/bash echo "Amisr ESF Online simulation" PATH_IN=/media/soporte/DATA/dataAMISR/20210716.003/ PATH_OUT=/home/soporte/Data/OutTest/ONLINE/20210716.003/ count=0 for f in $PATH_IN* do if [ ${f: -3} == ".h5" ] then echo "copying $f" cp ${f} $PATH_OUT echo "waiting new file..." sleep 3m #it takes about 5 minutes to generate new data in AMISR radar fi ((count=count+1)) if [ $count -eq 10 ] #only transfer 20 files then echo " finish simulation" break fi done