#!/bin/bash # Try to get home directory safely USER_HOME=$(getent passwd "$USER" | cut -d: -f6) MYZSH="$USER_HOME/.local/bin/zsh" if [ -x "$MYZSH" ]; then echo "user own shell" exec "$MYZSH" -i elif command -v zsh >/dev/null 2>&1; then echo "system zsh shell" exec "$(command -v zsh)" else echo "fallback, default bash" exec bash fi