从 bash 切换到 zsh 后不会创建符号链接

时间:2021-04-14 13:22:44

标签: bash macos shell zsh

我制作了一个 shell 脚本来自动化我的 mac 配置。我有一个循环,它根据此列表 e 中的文件数量创建符号链接。 :

files=".zshrc .gitconfig"

for file in ${files}; do
    echo "Creating symlink to $file in $homedir."
    ln -sf ${dir}/${file} ${homedir}/${file}
done

当我在 bash 中运行我的脚本时,它工作得很好。但是如果我在 zsh 中运行它,它会创建一个名为“.zshrc .gitconfig”的符号链接。我如何像在 bash 中一样迭代?

0 个答案:

没有答案
相关问题