我正在添加3行,从我喜欢的主题列表中选择一个zsh主题。这就是我想出的,但当然,它不起作用。我认为这是因为我声明了一个数组,它希望我在数组中有数字而不是字符串。我也可能混淆bash和zsh。
declare -a themes=("random" "half-life" "wezm" "sonicradish" "muse" "adben" "wedisagree" "ys" "dst" "tonotdo" "re5et" "jtrilley"); #list of 12 favorite themes
r=$((RANDOM%12)); #Pick random number 1:12
ZSH_THEME=${themes[$r]}; #Set the ZSH_THEME to the random choice