Hi Patrick,=0D=0A=0D=0AWhen I do the test on a RedHat, I get a rc 1 !=2E=0D=
=0A=0D=0A[donypie@linprd03 ~]$ cat a=2Esftp=0D=0Aget tuut=2Etest=0D=0A=0D=
=0A[donypie@linprd03 ~]$ sftp -b a=2Esftp localhost=0D=0Adonypie@localhost'=
s password:=0D=0Asftp> get tuut=2Etest=0D=0ACouldn't stat remote file: No s=
uch file or directory=0D=0AFile "/home/donypie/tuut=2Etest" not found=2E=0D=
=0A[donypie@linprd03 ~]$ echo $?=0D=0A1=0D=0A[donypie@linprd03 ~]$=0D=0A=0D=
=0A=0D=0ABut I have received news from Sun concerning this problem and they=
said=0D=0Athat : =0D=0A=0D=0AOpenssh sftp has changed in release 3=2E6p1, =
and *this* is why we are =0D=0Aseeing different behaviour e=2Eg=2E on a Lin=
ux distribution which bundles=0D=0Aa sufficiently recent OpenSSH suite=2E=
=0D=0A=0D=0AThese newer sftp binaries will indeed exit with a nonzero statu=
s when =0D=0Aone of the batched subcommands did not succeed as requested, a=
nd of =0D=0Acourse they will still do so when they encounter a protocol-lev=
el error=2E=0D=0A=0D=0A=0D=0AI hope they will implement these new features =
in SSH Sun as soon as=0D=0Apossible=2E=0D=0A=0D=0A=0D=0AThanks everybody=2E=
=0D=0APierre=2E=0D=0A=0D=0A=0D=0A-----Original Message-----=0D=0AFrom: Patr=
ick Morris [mailtomorris@hermesinfotech=2Ecom] =0D=0ASent: vendredi 5 mai=
2006 21:27=0D=0ATo: secureshell@securityfocus=2Ecom=0D=0ASubject: RE: FW: =
SSH/SFTP rc problem in Solaris=2E=0D=0A=0D=0AJust tried this on a Red Hat b=
ox (EL4)=2E I get a return code of 0 for=0D=0Athe same commands=2E =0D=0A=
=0D=0A> > We have a SSH return code problem when we use SSH in batch in=0D=
=0ASolaris=2E=0D=0A> > We haven't this problem on RedHat=2E =0D=0A> > =0D=
=0A> > bash-2=2E05$ cat a=2Esftp=0D=0A> > ls -l=0D=0A> > pwd=0D=0A> > get b=
=2Etxt=0D=0A> > ls -l=0D=0A> > bash-2=2E05$ sftp -b a=2Esftp scnsys11=0D=0A=
> > Connecting to scnsys11=2E=2E=2E=0D=0A> > Password: =0D=0A> > sftp> ls -=

l=0D=0A> > drwxr-xr-x 0 9108 10 512 Apr 21 11:15 =2E=0D=
=0A> > drwxr-xr-x 0 0 1 512 Apr 3 14:23 =2E=2E=0D=0A=
> > -rw------- 0 9108 10 2387 Apr 21 11:18=0D=0A=2E=2Ebash=

_history=0D=0A> > -rw------- 0 9108 10 240 Mar 28 16:19 =
=2Esh_history=0D=0A> > drwx------ 0 9108 10 512 Mar 22 17=
:11 =2Essh=0D=0A> > drwx------ 0 9108 10 512 Mar 22 16:00=
=2Essh2=0D=0A> > -rwxrwxrwx 0 9108 10 26 Mar 29 15:22 a=
=2Esftp=0D=0A> > -rwxrwxrwx 0 9108 10 0 Mar 28 15:28 a=
=2Etxt=0D=0A> > -rw------- 0 9108 10 1021424 Mar 22 17:07 cor=
e=0D=0A> > sftp> pwd=0D=0A> > Remote working directory: /export/home/huyseg=
o=0D=0A> > sftp> get b=2Etxt=0D=0A> > Couldn't stat remote file: No such fi=
le or directory File =0D=0A> > "/export/home/huysego/b=2Etxt" not found=2E=
=0D=0A> > sftp> ls -l=0D=0A> > drwxr-xr-x 0 9108 10 512 A=
pr 21 11:15 =2E=0D=0A> > drwxr-xr-x 0 0 1 512 Apr 3 =
14:23 =2E=2E=0D=0A> > -rw------- 0 9108 10 2387 Apr 21 11:=
18=0D=0A=2E=2Ebash_history=0D=0A> > -rw------- 0 9108 10 =
240 Mar 28 16:19 =2Esh_history=0D=0A> > drwx------ 0 9108 10 =
512 Mar 22 17:11 =2Essh=0D=0A> > drwx------ 0 9108 10 =
512 Mar 22 16:00 =2Essh2=0D=0A> > -rwxrwxrwx 0 9108 10 =
26 Mar 29 15:22 a=2Esftp=0D=0A> > -rwxrwxrwx 0 9108 10 =
0 Mar 28 15:28 a=2Etxt=0D=0A> > -rw------- 0 9108 10 1021424 =
Mar 22 17:07 core=0D=0A> > sftp> =0D=0A> > bash-2=2E05$ echo $?=0D=0A> > 0=
=0D=0A> > =0D=0A******************************************** ***************=
*************=0D=0A> > ************************************************** **=
****************=0D=0A> > ** As you can see in this example, sftp gives a r=
c =3D 0=2E If you try =0D=0A> > the=0D=0Asame=0D=0A> > on RedHat, you will =
receive a rc not equal to 0=2E=0D=0A=0D=0A=0D=0A=0D=0A---------------------=
--------------------=0D=0AVisit our website! http://www=2Enbb=2Ebe=0D=0A=0D=
=0A"DISCLAIMER: The content of this e-mail message should not be=0D=0Aconst=
rued as binding on the part of the National Bank of Belgium=0D=0A(NBB) unle=
ss otherwise and previously stated=2E The opinions=0D=0Aexpressed in this m=
essage are solely those of the author and do not=0D=0Anecessarily reflect N=
BB viewpoints, particularly when the content=0D=0Aof this message, or part =
thereof, is private by nature or does not=0D=0Afall within the professional=
scope of its author=2E"=0D=0A