Xref: utzoo comp.unix.shell:1746 comp.sources.d:6693 comp.os.misc:1729 comp.unix.misc:1177 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!bcm!lib!thesis1.med.uth.tmc.edu From: dfenyes@thesis1.med.uth.tmc.edu (David Fenyes) Newsgroups: comp.unix.shell,comp.sources.d,comp.os.misc,comp.unix.misc Subject: ash internals: evalstring() calls Summary: What is the proper way to invoke evalstring()? Message-ID: <4879@lib.tmc.edu> Date: 25 Mar 91 18:17:40 GMT Sender: usenet@lib.tmc.edu Followup-To: comp.unix.shell Organization: University of Texas Medical School at Houston Lines: 29 Nntp-Posting-Host: thesis1.hsch.utexas.edu Ash is certainly an undersold shell; for its power and flexibility, it's remarkably small. I was able to port ash to Coherent, a v7 variant, with little difficulty, and because Coherent won't run atty, I added a command line editor & history. I want to be able to expand variables in PS1, and also execute the contents of the variable EVERY befor each prompt. To do this, I call the function evalstring in eval.c. This works perfectly for valid expressions, but if there is a syntax error, the shell goes into an infinite loop, reporting the error endlessly. When the pre-existing code calls evalstring (for example, with the contents of SHINIT at startup) an error is reported once and evaluation is terminated properly. I have studied these invokations and can't find the difference. Is there anyone out there familiar with the internals of ash that can offer some insight?. Also, did anyone notice that a () (empty subshell) at the command line gives funny results (on my system it caused a reset). I avoided this by returning a syntax error on an empty subshell. (Obviously a kludge). Thanks a lot-- BTW, if anyone wants to alpha test this adaptation of ash, please contact me. If you currently use ash and don't have atty, or use sh and wish you had ksh, this may be an improvement. Personally, I think ash is every bit as powerful and not as huge as ksh. David. -- David Fenyes dfenyes@thesis1.hsch.utexas.edu University of Texas Medical School Houston, Texas