Many people like to move their bash profiles to a Dropbox folder so that they can have multiple machines with their same profile (usually, for those who have a custom and specific profile that they love). I would like to do the same thing with my zsh profile and Prezto framework.
I created a Dropbox folder in /Users/me/Dropbox/Computer Preferences/zsh/
(I will refer to this as DBFolder , hereon) which I would like to store my Prezto configuration in.
Here is the process that I've pursued:
{DBFolder}/.zprezto/runcoms/
The resultant symlinks live in ~/
. I added these lines to my zshenv file:
export ZDOTDIR="$HOME/Dropbox/Computer Preferences/zsh" if [[ "$SHLVL" -eq 1 && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then source "${ZDOTDIR:-$HOME}/.zprofile" path = /Users/me/bin fi
I am now able to launch my zsh profile with Prezto configurations. However, my problem is now that my initial login fails to load the path:
/Users/me/.zshenv:22: permission denied: /Users/me/bin
$ whoami
#=> me
My questions is - Why am I unable to access /Users/me/bin
when I am clearly logged in (via the $ whoami
) where it is within my home directory?
The problematic line is
path = /Users/me/bin
There are three problems:
$path
is an array in Zsh; $PATH
is the POSIX-compatible scalar. =
surrounded by spaces is a syntax error; assignment in POSIX shells should not contain spaces. $PATH
should be extended rather than overwritten. Correction:
PATH=$HOME/bin:$PATH
or
path=($HOME/bin $path)
The latter requires the ksharrays
option to be off (off by default).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.