UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 2.9 Speeding Up Your C Shell with set prompt Test Chapter 2
Logging In
Next: 2.11 Faster ksh and bash Startup with $- Test
 

2.10 Gotchas in set prompt Test

Lots of users add an if (! $?prompt) exit test (2.9) to their .cshrc files. It's gotten so common that some vendors add a workaround to defeat the test. For instance, some versions of the which command (50.8) set the prompt variable so that it can see your aliases "hidden" inside the $?prompt test. I've also seen a version of at that starts an interactive shell to run jobs.

If you've buried commands after if  (! $?prompt) that should only be run on interactive shells or at login time, then you may have trouble.

There are workarounds. What you'll need depends on the problem you're trying to work around.

Those workarounds probably won't solve all the problems on your version of UNIX, but I hope they'll give you some ideas.

- JP


Previous: 2.9 Speeding Up Your C Shell with set prompt Test UNIX Power ToolsNext: 2.11 Faster ksh and bash Startup with $- Test
2.9 Speeding Up Your C Shell with set prompt Test Book Index2.11 Faster ksh and bash Startup with $- Test

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System