From owner-freebsd-questions Thu Jun 28 23:32:21 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 5BA8C37B405 for ; Thu, 28 Jun 2001 23:32:18 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 48495 invoked by uid 100); 29 Jun 2001 06:32:17 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15164.8433.760308.623729@guru.mired.org> Date: Fri, 29 Jun 2001 01:32:17 -0500 To: Jim Freeze Cc: questions@freebsd.org Subject: RE: exporting TERM from a script In-Reply-To: <75835077@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jim Freeze types: > On Thu, 28 Jun 2001, Alex Dyas wrote: > > > On Thu, 28 Jun 2001, Alex Dyas wrote: > > > > Try running the script thus: > > > > $ . ./gonet > > > > > > > Hmmm, I get > > > $ . ./myscript.sh > > > .: Permission denied. > > > > > > Where as > > > $ ./myscript.sh > > > > > > runs fine, just no changing of the parents env. > > ah, could be a ksh thing in that case. what shell are you doing this in? > It doesn't work from tcsh on Solaris. tcsh uses csh syntax: "source myscript.csh". This will quickly point out one of the other differences between executing a script and sourcing it. If you execute it, what shell you're using doesn't matter. If you source it, it's read by the shell you're using, so the script must use commands valid for that shell. For example, tcsh will use "setenv" instead of "export" to export variables to the environment. > It does work from bash on FreBSD. Since it's supposed to be compatable with sh, that's not surprising. Since it supports a lot of csh syntax as well, that "source" also works is unremarkable. I'm not sure what to make of "setenv" not working in bash, though. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message