Article View: gnu.bash.bug
Article #830Re: bash bug report
From: Anders Ellefsrud
Date: Wed, 13 Dec 1989 17:28
Date: Wed, 13 Dec 1989 17:28
33 lines
1052 bytes
1052 bytes
> >I've been told by devout ksh users that it's missing autoload functions.
>
> autoload() {
> echo $1 \(\) \{ echo . $2 2\>\&1 \; . $2 \} > /tmp/au.$$
> . /tmp/au.$$
> rm /tmp/au.$$
> }
>
I see a few problems with that function. I think this is better:
autoload() {
eval `echo "$1" "() { args=\$@ ; . $2 ; set -- \$args; $1 \$@ }"`
}
Note: I said BETTER, not PERFECT! It will not handle funny arguments like
'foo bar'.
Usage:
autoload foo ~/lib/the_foo_function
.
.
.
foo bar
... works as expected, but
foo 'gaz onk' does not.
---
anders@ifi.uio.no
Technical Details
Message-ID:
<CMM.0.88.629573316.anders@digre.uio.no>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!sunic!nuug!ifi!digre!andersReferences:
<8912030428.AA01426@kailand.kai.com> <3749@convex.UUCP> <13693@reed.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!sunic!nuug!ifi!digre!anders
From: anders@digre.uio.no (Anders Ellefsrud)
Newsgroups: gnu.bash.bug
Subject: Re: bash bug report
Message-ID: <CMM.0.88.629573316.anders@digre.uio.no>
Date: 13 Dec 89 17:28:36 GMT
References: <8912030428.AA01426@kailand.kai.com> <3749@convex.UUCP>
<13693@reed.UUCP>
Sender: anders@ifi.uio.no
Lines: 33