Sunday, August 22, 2010

Daily Activities

Haven't done much today. Finally got my old zsh configuration copied over to the fresh install. So, I'm using zsh now. I thus used it to set append ~/.bin to my $PATH. This was somewhat tricky, because the only files this can be set it are *zshrc and *zshenv, both of which are called everytime a new instance of zsh is called. Thus when appending to $PATH in the method of `PATH=$PATH:~/.bin`, '~/.bin' will be appended with every new zsh. To fix this zsh can look for the appending of an array to be unique with `typeset -U $var`. It also breaks $PATH into its own zsh-style array $path. So, in zsh you can also append to $PATH by doing the following: `path=( ~/.bin $path) which will append ~/.bin to the beginning of $PATH. Put it all together and:

typeset -U path
path=( ~/.bin $path)

No comments:

Post a Comment