Krazy Ksh variable behavior

From: Baillargeon, Sonny (Sonny.Baillargeon@Bmonb.com)
Date: Thu Nov 06 2003 - 11:26:41 EST


Ok I have a simple problem with probably a simple answer.

I have a developer that needs to source a script that determines some
paths depending on some logic. The problem is that he won't be sending
it an arg everytime. And since it remembers the last variable he cannot
do an arg check like [ if ($3 == "") ] since it remembers it after the
first time he runs it with an arg.

In this test script he does this:

echo $3

When he executes test:

$ . test one two three
$ three

But he then executes the script again without any arguments and it still
prints "three".

Why does ksh remember the variable? This ksh on Solaris 8.

Thanks,
Sonny

<FONT SIZE =
1>***************************************************************************
*
This e-mail and any attachments may contain confidential and privileged
information. If you are not the intended recipient, please notify the sender
immediately by return e-mail, delete this e-mail and destroy any copies. Any
dissemination or use of this information by a person other than the intended
recipient is unauthorized and may be illegal. Unless otherwise stated,
opinions expressed in this e-mail are those of the author and are not endorsed
by the author's employer.</FONT>
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:25 EDT