Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!mimsy!eneevax!umd5!uvaarpa!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Michael Meissner) Newsgroups: comp.sources.wanted Subject: Re: BSD43 pushd/popd compatible progs on sysV Message-ID: <875@xyzzy.UUCP> Date: 16 May 88 21:51:24 GMT References: <792@miraculix.liu.se> <730001@hpmtlx.HP.COM> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 27 In article <730001@hpmtlx.HP.COM> kwb@hpmtlx.HP.COM (Keith Blackwell) writes: | | My understanding is that pushd and popd are commands built in to the | shell (csh only?) --- they *HAVE* to be built in since it is the shell's | working directory you want to change (stack-wise). Executable | programs can't do the job. So maybe what you | really want is a more useful shell! Note: if your shell | has command aliasing and array variables, you can build your own | version of pushd/popd with aliases. | Keith Blackwell | hplabs!hpmtlkb!kwb | BTW, I would be really interested (and surprised) in hearing about any | exceptions to my explanation! | 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. -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa: meissner@dg-rtp.DG.COM (or) meissner%dg-rtp.DG.COM@relay.cs.net