When I type echo $PATH
and echo $FPATH
I get different outputs. What are the differences between $PATH
and $FPATH
?
I use Mac OSX Mavericks.
FPATH
is the search path for function definitions.
FPATH The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the -u attribute is referenced and when a command is not found. If an executable file with the name of that command is found, then it is read and executed in the current environment. Unlike PATH, the current directory must be represented explicitly by . rather than by adjacent : characters or a beginning or ending :.
-- From the mac developer library
In addition to being used by ksh
as @robmayoff noted in his answer. zsh also uses it.
All shells on Unix-like systems search PATH
for an executable to run as a child process.
The Korn shell( ksh
) searches FPATH
for a file defining a shell function to load and execute in the current process.
The Z shell (zsh
) searches fpath
for a file defining a shell function to load and execute in the current process. See Autoloading Functions
.
Both are different environment variables and their value may not be same.
Also, see this link about environment variables
FPATH
Contains a list of directories that the z/OS shell searches to find shell functions.
PATH
Defines the default command path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With