Transfering files from one to another machine in different directories

view full story

http://www.unix.com – I have to write script in which I have to copy files from different directories on machine A and put them in corresponding directories in machine B. Here machine A remains same per project and machine B keeps on changing. Is there any way through which I can do this using single remote login (through sftp/ftp) on machine A from machine B or vice versa Can I change local directory from sftp? Thanks (HowTos)