if [ $(print - "$-" | grep -c "i") -gt 0 ] ; then print - "shell is interactive" else print - "shell is non-interactive" fi