The following is a series of conversations that took place on the subject of ZCPR3 Shells, a powerful UNIX-like utility that seems much under-utilized. These messages were taken from the Ladera Z-Node using the ZCPR3 RECORD function. Date: 15 Feb 86 18:55:16 PST From: JOHN POPLETT To: AL HAWLEY Re: SHELL GAMES Al, I recently fooled with a program called LUP.PAS (a Turbo- Pascal version of LUX) that seemed to me to have the right idea in that it uses existing RCP/M utilities (LDIR, TYPEL, XMODEM/ KMD) to do its job. It doesn't require it's own versions of these programs and that amounts to a considerably saving in cod e size. LUP.PAS uses the command line buffer to create its "menu" effects. But wouldn't this work more effectively as a shell? And in any case, how do I begin writing programs that take advantage of these sort of goodies. ZCPR3, I can see, presents a ripe opportunity to eliminate a lot of redundancy. What files do you recommend that I get to further my efforts? I'd like to be able to stick to 'C' and to MAC if possible. What do you recommend? John Poplett (PPR MBBS) Date: 18 Feb 86 12:46:15 PST From: FRED HAINES To: JOHN POPLETT Re: Z3 shells John, I'm not quite sure what you are loking for from your message, but, if you're willing to run your program under the ZCPR3 OS, you can designate any *.COM file whatever as a shell with the Z utility SHSET. What this does, essentially, is, when you leave program A, which you've designated as your shell, to run program B, the minute you finish with B, A will reload automatically. Beyond this, you can nest shells to several levels, and you can pass variables from one shell to another with SHVAR. One of the glories of the Z environment is a fabulous flexibility to maintain and manipulate shells, and I doubt whether any of us have even begun to explore the vast range of possibilities of this. If you're thinking about doing it in MS-DOS, I don't really know how you'd go about it, but you might be able to write a program that creates a shell stack, which is the feature of Z that makes all this possible. You would want to set it up more or less like any normal stack, except - if I'm not mistaken - you would want to store not addresses in it, but the actual name of the program. I guess that means storing the name upside down, pushing the last letter first, so when you popped the shell stack it would come out in the right order. It would have to be a very complicated program though.... Date: 22 Feb 86 18:38:44 PST From: SYSOP To: JOHN POPLETT Re: CHAINING/Z3 CMD BUF The documentation and code for chaining to another command on exit from BYE is contained in the file BYEMOD.LBR in the MODEM directory. It describes the modification to BYE, and contains a listing of the alias BYE chains to in my system. I'll try to u/l the file to you. The principle used is applicable to other programs as well, although the facilities of ZCPR3 are usually adequate to accomplish successive execution of programs without this kind of modification. The factor that makes this technique important with BYE is that BYE effectively 'cleans up' ZCPR3 buffers before exit in the cause of system integrity. That clean-up interferes with, for example, invoking BYE as a shell. If you have any questions, I'll try to answer intelligently.. Date: 26 Feb 86 23:03:14 PST From: JOHN POPLETT To: SYSOP Re: Z3 SHELLS Al, I wrote a provisional/experimental Z3shell this evening, a very simple matter. The prgm checks the shell stack and if no shell is active installs itself and prints a message to that effect (i.e. "Shell installed" a la SH.COM). Then, I go to a endless loop which prints a command line prompt, gets the command line, stuffs it in the Z3 cmd buffer and executes. If a control-c is entered from the command line, the shell uninstalls itself and returns to CP/M. You're BYEMOD code fragment was a big help. I wrote a 'C' function in ASM with the fragment as a model. Now here's a question: how do you think I could leave the shell to execute the Z3 cmd buffer without a warmboot in between? Right now, I'm playing it safe and jumping to warmboot at the end of the chain function. But I'd like to avoid the warmboot if possible. Is there a plac e in Z3 I can jump to simply to "load and go"??? J. Poplett P.S.-If you want to see my code, I'll be happy to send it u