Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!mcvax!ukc!its63b!simon From: simon@its63b.UUCP Newsgroups: comp.unix.questions Subject: Re: Korn Shell Message-ID: <344@its63b.ed.ac.uk> Date: Mon, 23-Mar-87 04:46:49 EST Article-I.D.: its63b.344 Posted: Mon Mar 23 04:46:49 1987 Date-Received: Thu, 26-Mar-87 04:20:14 EST References: <580@csun.UUCP> <5680@brl-smoke.ARPA> <2201@ptsfa.UUCP> <730@hoqax.UUCP> <772@bobkat.UUCP> Reply-To: simon@its63b.ed.ac.uk (ECSC68 S Brown CS) Organization: I.T. School, Univ. of Edinburgh, U.K. Lines: 30 Keywords: ksh aliases parameters execve export In article <772@bobkat.UUCP> m5d@bobkat.UUCP (Mike McNally (Man Insane)) writes: >In article <730@hoqax.UUCP> twb@hoqax.UUCP (BEATTIE) writes: >> ... >>Why can't aliases and functions be exported like shell variables? >>Tom. > >Because the overhead on an execve (or whatever under SV) would be >frightening. Actually, I have not found this to be the case (under both SysV and BSD). Mind you, I only export a "few" functions (well, a few dozen, anyway...). Any difference in speed seems to be completely undetectable. >Most of the time, the target of the execve is not the >shell. I suppose the shell could figure out when it should pass >functions across the environment (does SV have something like the >`#!interpreter' thing that BSD has?). This is irrelevent. I want my functions to be exported to *everything* - not just immediate shells. After all, even if what I'm execle'ing now isn't a shell, it could very well spawn off a subshell itself at some future date (eg, doing a ":sh" in vi, or a "!" escape in lots of things). (BTW, SysV execve doesn't recognize #!, but the shell itself can when it tries to execute a commandfile). -- ---------------------------------- | Simon Brown | UUCP: seismo!mcvax!ukc!{its63b,cstvax}!simon | Department of Computer Science | JANET: simon@uk.ac.ed.{its63b,cstvax} | University of Edinburgh, | ARPA: simon%{its63b,cstvax}.ed.ac.uk ... | Scotland, UK. | @cs.ucl.ac.uk ---------------------------------- "Life's like that, you know"