Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!husc6!wjh12!gst From: gst@wjh12.harvard.edu (Gary S. Trujillo) Newsgroups: comp.unix.questions Subject: How to test whether to read .kshrc (was Re: why no .kshrc file?) Summary: To read (.kshrc) or not to read... Keywords: ksh history sh csh Message-ID: <418@wjh12.harvard.edu> Date: 23 Oct 89 21:05:15 GMT References: <262@zeek.UUCP> <320@quad.uucp> Reply-To: gst@wjh12.UUCP (Gary S. Trujillo) Organization: Harvard University, Cambridge MA Lines: 19 Some time ago, I inserted the following into my .profile for use with ksh. I can't claim to understand the exact theory of operation, but it has the effect of constructing an ENV variable that evaluates to a null value iff the current shell is non-interactive, so that you don't waste time and CPU cycles processing aliases, and the like. START=~gst/.kshrc ENV='${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}' (I use "~gst" rather than just "~" so that it works when I su to root.) Now, in return for this gem of wisdom (obviously not original - I got it from a posting to unix-pc.general over a year ago), I hope someone will be able to answer my question about the "dd" command which I am about to post. Thanks! -- Gary Trujillo (gst@wjh12.harvard.edu)