Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!julius.cs.uiuc.edu!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!j.cc.purdue.edu!brazil.psych.purdue.edu!zhou From: zhou@brazil.psych.purdue.edu (Albert Zhou) Newsgroups: comp.lang.pascal Subject: Re: Patching a process in prompt Message-ID: <11684@j.cc.purdue.edu> Date: 14 Jan 91 21:06:10 GMT References: <25493@adm.brl.mil> Sender: news@j.cc.purdue.edu Reply-To: zhou@brazil.psych.purdue.edu (Albert Zhou) Organization: Purdue University Lines: 21 In article <25493@adm.brl.mil> ZCCBJSB%EB0UB011.BITNET@cunyvm.cuny.edu (Josep Sau B.) writes: > >Has anyone any idea/code to achieve that every time system >PROMPT appears a program gets called before? > It is possible to do this. However, it would be very slow since each time the program has to be loaded from the disk and executed. But anyway, you can do that with TP4.0 and up by writing your own shell (very easy, since you can make full use of the existing command interpreter). The code will be something like this: repeat execute you pre-prompt program (like this: exec(program, parameters); write prompt; read a command line; decide whether it is an internal command or an external one if it is an internal command then use this form: exec('command.comm`, `/c ` + commandline) else use this form: exec(command, parameters); until whatever;