I have the following script that works fine when called from the command line, however when I call the script from within my ~/.zshrc file the list of sessions is not converted to an array.#/usr/bin/env bash# Get tmux sessions and add option for a new oneTMUX_SESSIONS=$(tmux list-sessions -F #S) \  new;echo ${TMUX_SESSIONS}echo Which tmux session, or enter string for a new one;select TMUX_SESSION in ${TMUX_SESSIONS}; do  case $TMUX_SESSION in    new )      while [[ ${TMUX_SESSION} == new || ${TMUX_SESSION} ==  ]]; do        read -p Session name:  TMUX_SESSION        echo \${TMUX_SESSION}\      done      tmux new -s ${TMUX_SESSION}      ;;    * )      tmux attach -t ${TMUX_SESSION}  esac  breakdoneOutput when I run manually (as expected)api base limtool newWhich tmux session, or enter string for a new one1) api2) base3) limtool4) newOutput when run from ~/.zshrcapibaselimtool   newWhich tmux session, or enter string for a new one1) apibaselimtool   newThis is on a Mac, for reference.
Why is my list not being converted to an array in .zshrc startup script?
zsh