On Apr 9, 2005 4:41 PM, Richard Fish <[EMAIL PROTECTED]> wrote:
> Maxim Vexler wrote:
> 
> >I can't quite understand the purpose of this "(alias; declare -f)" 
> >expression.
> >
> >
> 
> If you don't have any aliases or functions defined in your shell, you
> won't see anything from running 'alias; declare -f'.
> 
> An example:
> 
>  ~ > alias e='echo'
> ~ > e foo
> foo
> ~ > f() {
> > echo "function"
> > }
> ~ > f
> function
> ~ > alias ; declare -f
> alias e='echo'
> f ()
> {
>     echo "function"
> }
> 
> -Richard
> 
> --
> gentoo-user@gentoo.org mailing list
> 
> 

Oh, ok.
I think I got it:

"(alias; declare -f)" is a method of piping to the stdin of [which]
all the functions & alias's that the user has defined.
Then using the --read-alias --read-functions the [which] program knows
to include those in her search path when queried.
The "export -f which" causes the shell to replace the bin which
program with the function "which".

Talk about shell judo...
neat!

Thank you for helping.

-- 
Cheers, 
Maxim Vexler (hq4ever).

Do u GNU ?
--
gentoo-user@gentoo.org mailing list

Reply via email to