Need Help on SFTP login from another server

view full story

http://www.unix.com – Hi Experts, I am writing one shell script. Below is the requirement 1. need to login to the SFTP server, go to the particular folder 2. take the file count in that folder and assign it to variable 3. came out of the SFTP server and check the condition, if the file count is less than the required count exit the script other wise further processing 4. then we need to move the files from SFTP to another server. 5. Need to check the file count in another server if all the files are not copied print the error msg and exit the script. please help me with the sudo code. I am trying the below code (HowTos)