wfxr
8/2/2017 - 2:31 AM

Bash代码片段

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.