Você pode fazer algo assim:
files=$( ls -l --time-style=+%D | grep $(date +%D) | grep -v '^d' | awk '{print $NF}' ) ; for f in $files ; do cp -rf $f /home/oracle/SABARISH/logs/files/ ; done ; sftp {user}@{host}:{remote_dir} <<< 'put /home/oracle/SABARISH/logs/files/*'
ou similarmente:
for f in $(ls -l --time-style=+%D | grep $(date +%D) | grep -v '^d' | awk '{print $NF}') ; cp -rf $f /home/oracle/SABARISH/logs/files/ ; done ; sftp {user}@{host}:{remote_dir} <<< 'put /home/oracle/SABARISH/logs/files/*'
O awk é usado para extrair nomes de arquivos.
#!/bin/bash
FILES=$(ls -l test1_*.txt --time-style=+%D | grep ${DATE} | grep -v '^d' | awk '{p rint $NF}' )
if [ -n "${FILES}" ]
then
for f in ${FILES}
do
cp -prf ${f} ${DESTINATION}
done
sftp ${USER}@${HOST}:${CD} <<< 'put /home/oracle/SABARISH/logs/sftp/*'
else
echo "NO FILES TO MOVE"
fi