To execute next UNIX command after ending SFTP process.

Hi,
I am trying to run a simple UNIX command after i successfully executed SFTP command as shown below.
-----------------------------------------
echo 'Step-1'
sftp -vvv -b path
exit
echo 'Step-2'
------------------------------------------

In above script it executes from the 1st 'echo' command till the 'exit' then comes out of the script. But my requirement is to also execute the 2nd 'echo' command. So is there a way to run further UNIX command after SFTP, even by calling another script to run further command is fine.

Thanks for your help..

Skip the exit. If you are echoing your ftp-style commands, pipe it through to sftp:

 
echo "put $myfile $hostdest/$hostfile" | sftp $verbosity $hostpass $hostuser@$hostname >>$MYLOG 2>&1 

Otherwise, you do much better with scp:

 
scp $loclfile $hostuser@$hostname:$trgtdir/. 

My problem is not in using SFTP command, but not able to execute any UNIX command after i successfuly completed SFTP. Currently it exits out of script after SFTP command, which i need to use. Is there a way to exit out of SFTP ?
Thanks

Again, skip the exit ... Pipe the echo through sftp which will effectively exit on its own.