diff --git a/.profile b/.profile
index ff7b2958..b31a0968 100644
--- a/.profile
+++ b/.profile
@@ -1,4 +1,10 @@
# https://tratt.net/laurie/blog/2024/faster_shell_startup_with_shell_switching.html
-if [[ $- == *"i"* ]]; then
- exec zsh
-fi
+case $- in
+ *i* )
+ if command -v zsh > /dev/null; then
+ # make sure zsh actually runs
+ zsh --version > /dev/null && exec zsh
+ echo "Couldn't run 'zsh'" > /dev/stderr
+ fi
+ ;;
+esac