linux - Shell out into zsh and execute commands from bash script -
i'm trying hand little virtualisation, i've been using vagrant provision centos7 vm , configuring applications.
my vagrant config runs bootstrap.sh file bash script, in install zsh, want configure per https://github.com/sorin-ionescu/prezto . step 1 launch zsh run commands.
this code have @ moment.
echo "installing zsh" yum install -y zsh echo "configure zsh" # touch /home/vagrant/.zshrc exec /usr/bin/zsh git clone --recursive https://github.com/sorin-ionescu/prezto.git "${zdotdir:-$home}/.zprezto" setopt extended_glob rcfile in "${zdotdir:-$home}"/.zprezto/runcoms/^readme.md(.n); ln -s "$rcfile" "${zdotdir:-$home}/.${rcfile:t}" done chsh -s /bin/zsh
i want default shell when ssh vm. not appear working, there no errors vagrant step want know if possible , if seems correct?
thanks
exec zsh
replaces shell zsh -- doesn't in way tell instance of zsh pick @ same point in execution, or run same script bash invocation executing @ all.
one easy fix feed rest of script zsh via heredoc:
/usr/bin/zsh <<'eof' git clone --recursive https://github.com/sorin-ionescu/prezto.git "${zdotdir:-$home}/.zprezto" setopt extended_glob rcfile in "${zdotdir:-$home}"/.zprezto/runcoms/^readme.md(.n); ln -s "$rcfile" "${zdotdir:-$home}/.${rcfile:t}" done chsh -s /bin/zsh eof
Comments
Post a Comment