Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!cwns1!chet From: chet@cwns1.CWRU.EDU (Chet Ramey) Newsgroups: comp.unix.shell Subject: Re: command line prompt (need current directory) Message-ID: <1990Sep14.135525.8981@usenet.ins.cwru.edu> Date: 14 Sep 90 13:55:25 GMT References: <1683@ispi.COM> <13669@hydra.gatech.EDU> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Distribution: comp Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 32 In article <13669@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (BURNS,JIM) writes: >Ksh allows you to export functions with (for me): > >typeset -fx cp ll man This will not export the functions to separate invocations of ksh. Only shells `spawned' by ksh to execute scripts will inherit these function definitions. There is no way to export functions to separate invocations of the shell; you must do it via the $ENV file. >I'm not aware of any way to do it in sh, and haven't run across any csh's >that support functions, per se (not aliases). There aren't any. >Most shells will search for a builtin before executing an alias or >function. For a function that replaces the behavior of an external, >specify the pathname for the 'inside' invocation of the command, as in: The Korn Shell and Bash will do alias substitution first. It's really the last stage of token recognition rather than part of command execution. For bash, the order of lookup is function, builtin, file system (Posix is the same way). For ksh, it's builtin, function, file system. Chet -- Chet Ramey ``Levi Stubbs' tears run down Network Services Group his face...'' Case Western Reserve University chet@ins.CWRU.Edu