From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 15 Apr 2006 01:33:45 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20060414213345.GD11323@localhost> Mail-Followup-To: ALT Devel discussion list References: <20060414154621.GA3423@localhost> <443FE885.7090807@altlinux.org> <20060414193432.GC11323@localhost> <44400281.1090902@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GyRA7555PLgSTuth" Content-Disposition: inline In-Reply-To: <44400281.1090902@altlinux.org> Subject: Re: [devel] /bin/sh errexit semantics X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.7 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2006 21:34:12 -0000 Archived-At: List-Archive: List-Post: --GyRA7555PLgSTuth Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 15, 2006 at 12:13:53AM +0400, Alexey Rusakov wrote: > > =F0=CF=CC=D5=DE=C1=C5=D4=D3=D1, =DE=D4=CF =D7 errexit mode =CE=C5=D7=CF= =DA=CD=CF=D6=CE=CF =D3=C4=C5=CC=C1=D4=D8 wrapper =C4=CC=D1 =C6=D5=CE=CB=C3= =C9=C9, > > =CB=CF=D4=CF=D2=D9=CA =D0=D2=CF=D7=C5=D2=D1=C5=D4 =CB=CF=C4 =D7=CF=DA= =D7=D2=C1=D4=C1 =DC=D4=CF=CA =C6=D5=CE=CB=C3=C9=C9. =EE=C5=CB=CF=CE=D3=C9= =D3=D4=C5=CE=D4=CE=CF. =EE=C1=D0=D2. =D7 > > =D3=CB=D2=C9=D0=D4=C5 cmdcache =C9=D3=D0=CF=CC=D8=DA=D5=C5=D4=D3=D1 =D4= =C1=CB=C1=D1 =CB=CF=CE=D3=D4=D2=D5=CB=C3=C9=D1: > > > > rc=3D0 > > "$@" >out$$ || rc=3D$? > > if [ $rc -eq 0 ]; then > > =D3=CF=C8=D2=C1=CE=C9=D4=D8 =D7 =CB=C5=DB out$$ > > else > > =D5=C4=C1=CC=C9=D4=D8 out$$ > > return $rc > > fi > > > > =F0=CF=D3=CB=CF=CC=D8=CB=D5 errexit =D7 =D4=C1=CB=CF=CD =D3=CC=D5=DE=C1= =C5 =CE=C5 =D2=C1=C2=CF=D4=C1=C5=D4, "$@" =D3=CB=CF=D2=C5=C5 =D7=D3=C5=C7= =CF =D7=C5=D2=CE=A3=D4 0. > > =E5=D3=CC=C9 =D6=C5 =D5=C2=D2=C1=D4=D8 '|| rc=3D$?', =D4=CF =CE=C5=D7= =CF=DA=CD=CF=D6=CE=CF =C2=D5=C4=C5=D4 =D5=C4=C1=CC=C9=D4=D8 out$$ =D7 =D3= =CC=D5=DE=C1=C5 > > =CE=C5=CE=D5=CC=C5=D7=CF=C7=CF =D7=CF=DA=D7=D2=C1=D4=C1. > > =20 > =E1 =D4=C1=CB? >=20 > "$@" >out$$ && : > rc=3D$? =F7=D2=CF=C4=C5 =D4=CF =D6=C5 =D3=C1=CD=CF=C5. =F1 =D6=C5 =C8=CF=DE=D5 =DE= =D4=CF=C2=D9 "$@" =CF=D4=D7=C1=CC=C9=CC =CB=C1=CB =C2=D5=C4=D4=CF =D7 =D2= =C5=D6=C9=CD=C5 errexit, =CE=CF =CE=C5 =D3=CF=D7=D3=C5=CD =CF=D4=D7=C1=CC=C9=CC, =C1 =D7=C5= =D2=CE=D5=CC =D3=D4=C1=D4=D5=D3 =CF=D4=D7=C1=CC=C9=D7=DB=C5=CA =CB=CF=CD=C1= =CE=C4=D9. #!/bin/sh -ef func() { =20 false echo 'after false' } func && : func=20 + false + echo 'after false' after false + : + func + false =EB=C1=D6=C5=D4=D3=D1, =CC=D5=DE=DB=C5=C5 =D7 =CE=C5=CB=CF=D4=D2=CF=CD =D3= =CD=D9=D3=CC=C5, =DE=D4=CF =DA=C4=C5=D3=D8 =CD=CF=D6=CE=CF =D3=C4=C5=CC=C1= =D4=D8, =DC=D4=CF =CF=D4=D7=C1=CC=C9=D4=D8 =D3=CF=D7=D3=C5=CD (=D4=CF =C5=D3=D4=D8 "=DE=C5=D3=D4=CE=D9=CA" errexit) = =C9 =CF=D3=D4=C1=D7=C9=D4=D8 out$$. --GyRA7555PLgSTuth Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFEQBU5fBKgtDjnu0YRAn9fAKCkQQ+xUGtIHfy4YDUobkIbmbOkYQCdHPiu Uu7koX0w/XZYDtoIc1ga/d8= =QH/L -----END PGP SIGNATURE----- --GyRA7555PLgSTuth--