Faster ksh and bash Startup with $- Test
Do you use the Korn shell - and does your account have an "ENV file" () (a startup file named in the ENV environment variable)? bash users, you probably have setup files like bashrc or bash_login. You might have the same problem () that C shell users have with cshrc: noninteractive shells read aliases and other lines that you want to be read only by interactive shells. Speed up your file by adding a test like this:
case |
case $- in *i*);; *) return 0;; esac # COMMANDS BELOW THIS LINE WILL ONLY BE RUN BY INTERACTIVE SHELLS: ... |
---|
The test checks to see if the shell's -i option is set. If it isn't, the return
quits the file.
- JP