OT: setting variables

Nick Guenther kousue at gmail.com
Wed Mar 11 04:36:01 CET 2009


On Tue, Mar 10, 2009 at 11:20 PM, Mike Erdely <mike at erdelynet.com> wrote:
> On Tue, Mar 10, 2009 at 11:11:23PM -0400, Nick Guenther wrote:
>> This confused me for SO LONG. The trick is to "source" the file
>> instead of running it as so:
>> . ./script
>> or
>> source ./script
>>
>> You'd think "EXPORT" exports the value to the entire OS, but no, it
>> only exports it beyond the that command line. It sort of makes sense
>> in the context that can do this to pass variables to programs:
>> $ VAR=VAL ./script
>>
>> Unix is crazy.
>
> Actually, read my explanation.  It will make sense to you then.

It makes sense in a logical-reductionist way, if you focus on the
actions and not the words; it's just kind of counter intuitive :)
-Nick


More information about the Openbsd-newbies mailing list