On 10/7/05, Kevin Lombardo <kevin.lombardo at gmail.com> wrote:
> Hello-
>
>  I am creating a shell script to transfer files with sftp. The script works,
> but I'm not sure how to handle problems, such as incomplete downloads due to
> network issues.
>
>  Does anyone have any suggestions on how to check/handle sftp errors from
> within a shell script?

The variable "$?" gives you the exit status of the last command. 
Check it immediately following your sftp command.  Most well written
UNIX programs will return 0 on success and non-zero otherwise.

Scot