Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: exec environment variables Keywords: perl environ exec Message-ID: <11003@jpl-devvax.JPL.NASA.GOV> Date: 10 Jan 91 22:40:59 GMT References: <1991Jan10.174034.21512@magnus.ircc.ohio-state.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 22 In article <1991Jan10.174034.21512@magnus.ircc.ohio-state.edu> bobd@magnus.ircc.ohio-state.edu (Bob DeBula) writes: : I am trying to write a very simplistic shell in PERL which : mainly exists to restrict the user to just one program. : What I need to know is how to pass a fake environment variable : (remember this PERL program is the shell) on to the program : I am calling so that the editor (VI) will believe that : $TERM is set to vt100. Is this a brain dead idea to begin with? : Does anyone have or can provide an example? Thanks in advance. #!/usr/bin/perl $ENV{'TERM'} = 'vt100'; exec "program", "arg1", "arg2"; You could also say #!/usr/bin/perl exec "TERM=vt100 program arg1 arg2"; but that brings the shell into play, in which case you could have just used a shell script in the first place. Larry