I have been slightly confused about the extraneous use of shell functions.
My definition of a shell function: a function which is in .bashrc such that
.bashrc
--- other default bash configs ----
extract() { // I call this a shell function
....
}
My definition of a function put to PATH: a file which folder is at PATH. For example, we have the file ~/bin/screen/convert.screen
To add the file and other files in the folder to my PATH, I can have the following PATH
export PATH='/Users/masi/bin/screen:'
I would like to know when I should put the function as a login shell function and when to my PATH. I prefer the latter at the moment, since the former increases costs of maintenance.
Which is the advantage of an user-made shell function that a function in your PATH does not have?