Skip to content

Instantly share code, notes, and snippets.

@wfxr
Last active August 2, 2017 02:32
Show Gist options
  • Save wfxr/ce156dd3e5576fbfc280e32e87e44bd7 to your computer and use it in GitHub Desktop.
Save wfxr/ce156dd3e5576fbfc280e32e87e44bd7 to your computer and use it in GitHub Desktop.
Bash代码片段
# 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