Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

How do you decide whether to make something a function or a script?



I've been moving some of my more elaborate functions into their own files
and using the autoload feature to import them into other scripts.

But it's gotten me to wonder:

Why make any functions at all? Why not just make them all scripts? If they
are scripts in the $PATH then you can just call them by name and they work
in the login shell or in scripts. If they are functions, you have to
autoload them first.

So I've gotten to wonder… what makes you make something a function vs a
script?

TjL

--
TJ Luoma
TJ @ MacStories <http://www.macstories.net/author/tjluoma/>
Personal Website: luo.ma <http://luo.ma/> (aka RhymesWithDiploma.com
<http://rhymeswithdiploma.com/>)
Twitter: @tjluoma <http://twitter.com/tjluoma>


Messages sorted by: Reverse Date, Date, Thread, Author