-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 7/30/13 10:30 AM, Chris Down wrote: > On 2013-07-30 10:18, Greg Wooledge wrote: >> After the fork() which creates the subshell, each of the two processes >> (parent and child) is still within its own instance of the function. >> The "return" command executed in the child causes the child's function >> to terminate, but this does not cause the parent's function to terminate. > > I think we all understand the technical reasons *why* this occurs, that has > seemed clear since the beginning. My concern is that I think it is > semantically > wrong to act as if we are still in a function when in a child, and accept a > return statement there.
And we are now back to where we were yesterday at this time: most people aren't really aware of when and how subshells are created. Why should a pipeline in a function cause `return' to raise an error? (And this can change based on the value of the `lastpipe' shell option.) Chet > - -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlH4Df4ACgkQu1hp8GTqdKtpxACgijLSEfNL6LKfETChX/9TyrQc S2QAniY+QeybzddyVp/BnP6hejtrWVUL =5XzB -----END PGP SIGNATURE-----