2

When first installing powerlevel10k, one usually follows the guides available on the Internet and clone the repository inside oh-my-zsh's folder:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Now, if I echo $ZSH_CUSTOM I will get /home/myuser/.oh-my-zsh/custom as expected, but printenv will not list it at all. Why is that?

1 Answers1

3

The :- in the variable tells bash (or zsh) to use whatever is after the - as the default value. If ZSH_CUSTOM is not in your environment variables (it doesn't show up in printenv), it will default to $HOME/.oh-my-zsh/custom.

You can try it yourself:

echo ${MY_VARIABLE}
# prints an empty line
echo ${MY_VARIABLE:-a default value}
# prints: a default value
Gert
  • 9,994