Re: INF4GL and shell-variable: /bin/csh ???
Posted in 1991
> In <list.196>, Dieter Becker writes: > > So I must type: run "SHELL=-;export SHELL; w | less" with > SHELL=/bin/sh before 4gl-start. > > Is there another user-friendly way for using run without allowing > shell-commands in subshells? We had a similar problem when we were developing one of our current systems. In it, we set SHELL=/bin/sh as the default. Theoretically, all good little Unix utilities that allow you to "bang out" should inspect $SHELL, and not do anything if it is NULL. However, we found that certain commands didn't do things exactly right. We separated the good from the bad by trial and error. Some did fine. In many places, we say: run "SHELL='' goodprog arg1 arg2 ..." if goodprog inspects $SHELL correctly. Your /bin/sh *should* allow you to set environment variables at the front of any command line. The settings are in effect for that child process only (and its children). For those programs that don't inspect $SHELL correctly, we found that we can use a line like: run "SHELL=fakeshell badprog arg1 arg2 ..." The program "fakeshell" is just a one-line shell script that echoes an error message. In programs where this is necessary, it appears that if $SHELL is defined, that program is used. If $SHELL is undefined or set to a null string, /bin/sh is used. This may not work for all such programs, but it does for the ones that we use. "mail" is one such program on our system. I checked on our system, and w | SHELL=fakeshell less works as I described. I didn't try it in a 4GL run statement. You might try this approach or some variation. As an aside, I've never been 100% sure that there wasn't some hole in this system. We are currently migrating to a scheme where users run a menu-driven collection of programs from the shell. None of these program will allow users to bang out. Hope this helps, Walt. -- Walt Hultgren Internet: walt@rmy.emory.edu (IP 128.140.8.1) Emory University Alternates: walt%rmy.emory.edu@uunet.uu.net 954 Gatewood Road, NE walt%rmy.emory.edu@wsmr-simtel20.army.mil Atlanta, GA 30329 USA BITNET: walt@EMORY Voice: +1 404 727 0648 UUCP: {...,gatech,rutgers,uunet}!emory!rmy!walt