I use z shell via “oh my zsh”. I’d like to source multiple alias files from within my .zshrc file so I can keep things well organized. I’ve prefixed the alias files with .alias_ so I can wildcard load them. But, a call to source ~/.alias_* only loads the first file. How can I script it to source multiple files?
Filename examples: .alias_git, .alias_local, .alias_server…
Option 1
You could use a for loop:
Option 2
The other option is to build an array of all the files you want to source and then iterate over the array using a for loop.
This can actually be quite effective in making a well organized zshrc setup.