Path: utzoo!attcan!uunet!husc6!bloom-beacon!gatech!mcnc!uvaarpa!virginia!uvacs!rwl From: rwl@uvacs.CS.VIRGINIA.EDU (Ray Lubinsky) Newsgroups: comp.sources.wanted Subject: Re: BSD43 pushd/popd compatible progs on sysV Message-ID: <2408@uvacs.CS.VIRGINIA.EDU> Date: 17 May 88 12:36:42 GMT References: <792@miraculix.liu.se> <730001@hpmtlx.HP.COM> <875@xyzzy.UUCP> Organization: U.Va. CS in Charlottesville VA Lines: 25 In article <875@xyzzy.UUCP>, meissner@xyzzy.UUCP (Michael Meissner) writes: > One particularly grungy way of supporting pushd/popd just occurred to > me. Basically pushd would spawn a subshell in the pushed directory. > It would also stuff somewhere (like the environment) it's process id. > Popd would then send a signal to popd, which would kill the subshell > (and presumably popd). Each pushd would consume 1-2 processes, and > you would have to do as many popd's as you did pushd's. Before you > flame me, I did warn you it was grungy, and is more proof of concept. Yup, that's grungy alright. Even with this, I don't see how you could emulate the full behavior of the C-shell's pushd/popd, namely the ability to "roll" the stack and selectively popd from the middle of the stack. I'm pretty sure that SYSV is not going to let you do the kind job control needed to continue the kludge with pushd/popd programs. Shells with functions are another matter; it's pretty straight-forward to emulate those builtins there. If anyone would like to see my Korn shell alias & function set for doing pushd/popd, let me know. If I get a few responses, I'll post. -- | Ray Lubinsky, UUCP: ...!uunet!virginia!uvacs!rwl | | Department of BITNET: rwl8y@virginia | | Computer Science, CSNET: rwl@cs.virginia.edu -OR- | | University of Virginia rwl%uvacs@uvaarpa.virginia.edu |