Friends,
I need your help on for loop in sftp process.
I want to get the files from remote server and rename the files in the remote location with .arc extension just to tell them we picked the records.
I am connectiong to remote server
using
sftp -b $xxap_top/sql/command_file abc.a.bc.com
command_file is my batch file and the content is like this
cd $XXHR_TOP/sql
mget ap_invoice*
for FILE in $(ls ap_invoice*);
do
rename $FILE $FILE.arc
done
quit
I am getting error as invalid command at the for loop . Is there any other way I can rename the files ? IF rename wont work at least I should able to move them to a different location on remote server.
I tried with mv command, rename comamd, for loop.... and dont know how to make it work.
Thanks
Sri.