Created
March 24, 2017 18:44
-
-
Save cesarkawakami/90e63709b60f596124410e998c39330d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# macOS: Read global PATH and MANPATH | |
function __read_system_path | |
set -l var_name $argv[1] | |
set -l filenames $argv[2..-1] | |
set -x $var_name | |
for filename in $filenames | |
while read -l path | |
set -x $var_name $$var_name $path | |
end < $filename | |
end | |
end | |
__read_system_path PATH /etc/paths /etc/paths.d/* | |
__read_system_path MANPATH /etc/manpaths /etc/manpaths.d/* | |
functions -e __read_system_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment