> Hello
> I have problem using alias inside autoloaded function,
> it can be illustrated with the following example:
> there is function definition file ./foo
> function foo {
> msg
> }
> ... and the main script ./main
> #!/bin/ksh
> alias msg='print Hello!'
> FPATH=.
> autoload foo
> foo
Write a function instead of using an alias...
function msg
{
print "Hello!"
}
In a very limited context alias is fine for interactive shell use;
for scripting it makes more problems (more or less subtle) than is
of help, and it is not really necessary to use it here.
Quote:> when executing main script, there is error:
> ./main: foo[2]: msg: not found [No such file or directory]
> what's wrong with this example?
> It does't work under AT&T ksh (linux.i386 binary),
> but works fine when use pdksh
Alias behaviour has changed from ksh88 to ksh93 (pdksh was -partly-
based on ksh88 functionality); for example, in ksh93 it is not
possible any more to export aliases to external scripts. I have no
ksh88 at hand so I cannot tell whether the behaviour you expect was
present in ksh88.
Janis
Quote:> blazk