我有以下幾點:意外行爲-sfn -v
if [ $kernel == 'Darwin' ]; then
$HOME="/Users/$user"
elif [ $kernel == 'Linux' ]; then
$HOME="/home/$user"
fi
# Let the script know what the dotfiles dir is
dotfiles_dir="$HOME/dotfiles"
# Making symlinks to shell files, add yours as you need
echo 'Making symlinks to shell files'
ln -sfn -v $dotfiles_dir/shells/zsh $HOME/.zsh
ln -sfn -v $dotfiles_dir/shells/zsh/zshrc $HOME/.zshrc
ln -sfn -v $dotfiles_dir/shells/bash $HOME/.bash
ln -sfn -v $dotfiles_dir/shells/bash/bash_profile $HOME/.bash_profile
ln -sfn -v $dotfiles_dir/shells/bash/bashrc $HOME/.bashrc
ln -sfn -v $dotfiles_dir/shells/profile $HOME/.profile
echo "Done at [$time]...\n"
然而,這種奇怪的輸出:
[Other output here...]
Making symlinks shell files
/Users/eduan/.zsh -> /Users/eduan/dotfiles/shells/zsh
/Users/eduan/.zshrc -> /Users/eduan/dotfiles/shells/zsh/zshrc
/Users/eduan/.bash -> /Users/eduan/dotfiles/shells/bash
./bashrc -> /Users/eduan/dotfiles/shells/bash/bashrc
/Users/eduan/.profile -> /Users/eduan/dotfiles/shells/profile
Done at [08:15]...
[Other output here...]
任何人能告訴我,爲什麼我得到這個意外的輸出?我的符號鏈接的其餘部分正確生成,不過Bash的符號連接出現混亂的某些原因。
順便說一句,這是在生成符號連接一個大的腳本。這只是它的一部分,我把相關的部分放在了一起,這樣你就不會感到困惑。 :)
編輯:
這裏的鏈接到腳本的最新版本:https://github.com/Greduan/dotfiles/blob/master/scripts/make_symlinks.sh
沒有明顯的語法錯誤,我可以看到。如果不能複製你的結果,我所能建議的就是你還沒有告訴我們。也許更多的信息是相關的。 – ghoti
@ghoti下面是該腳本的最新版本:https://github.com/Greduan/dotfiles/blob/master/scripts/make_symlinks.sh – greduan
很高興我能提供幫助。 – ghoti