Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help with FOR LOOP in sftp unix

user12294571Jun 5 2013 — edited Jun 5 2013
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.
This post has been answered by Dude! on Jun 5 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2013
Added on Jun 5 2013
3 comments
6,463 views