What's the preferred way to determine if a given ksh invocation is running an interactive shell?
I have some commands in an ENV file that I would like to skip for non-interactive ksh invocations (e.g. when executing a shell script).
I've seen suggesting ranging from:
if [[ $- = *i* ]]; then
# do interactive stuff
fi
...to not even sourcing .kshrc unless the shell is determined to be interactive using this cryptic incantation:
ENVIRON=$HOME/.kshrc export ENVIRON
ENV='${ENVIRON[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}' export ENV
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)