[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why bash exports variables implicitly?



Shaul Karl <shaulka@bezeqint.net> writes:

> $ MYVAR=testing
> $ printf "$MYVAR\n"
> testing
> $
> 
> It looks like bash mark variables and function which are modified or 
> created for export to the environment of subsequent commands.

No, the variable is not marked for export (unless you've got a set -a
somewhere in your init scripts). In your test above, the MYVAR variable
will be expanded before printf ever sees it. If you want to see if a
variable is exported, use:

  env | grep MYVAR

-- 
Dave Carrigan (dave@rudedog.org)            | Yow! Sometime in 1993 NANCY
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | SINATRA will lead a BLOODLESS
Seattle, WA, USA                            | COUP on GUAM!!
http://www.rudedog.org/                     | 


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: