Last active
August 2, 2017 02:32
-
-
Save wfxr/ce156dd3e5576fbfc280e32e87e44bd7 to your computer and use it in GitHub Desktop.
Bash代码片段
This file contains 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
# bash 遍历文件 | |
if [[ -d "/etc/zsh.d" ]]; then | |
for f in /etc/zsh.d/*.zsh(N); do | |
source $f | |
done | |
fi | |
# The (N) tells zsh to set the NULL_GLOB option for that pattern. When no | |
# matches are found, the glob expands to an empty string instead of throwing an | |
# error. In zsh a for loop over an empty expansion does nothing, which is the | |
# behavior we want here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment