Dennis Williamson wrote:

Aliases are intended for command line convenience. You should use
functions, which can be exported and are the correct thing to use in
scripts (and even from the command line).

"For almost every purpose, shell functions are preferred over aliases."

But, of course, you know that already.

---
        Yeah... and I've already demonstrated the 'almost' part.

It's one of those:

function _include_h { return "source <liblookup>$1" ;}


alias include='eval $( _include_h "$1")'

Near as I can tell, you can't do that in a function.
If you source a file in a function, the local vars in the file
would be local to the function -- not to the prog using the alias


I thought I did suggest that line be corrected -- so people wouldn't
think functions replace aliases...
Since for some purposes, functions cannot replace aliases.

Now that I've justified another usage (similar to previous that eval'ed a result), -- how about how do I export aliases??





Reply via email to