[Top][All Lists]

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

Re: [Nmh-workers] Environment variables - with or without $?

From: Robert Elz
Subject: Re: [Nmh-workers] Environment variables - with or without $?
Date: Fri, 24 Mar 2017 05:35:59 +0700

    Date:        Thu, 23 Mar 2017 17:35:55 -0400
    From:        Paul Fox <address@hidden>
    Message-ID:  <address@hidden>

  | really?  do tell!

If command (in the example I gave) is a function, posix requires that
X be set in the shell (for subsequent commands) whereas if it is a
binary, X must not be altered from whatever it was before.

In the function case, it is undefined whether (assuming it was not already
exported) X will be marked for export.

This is all just because of the way ksh implemented functions.

Don't rely upon it necessarily being that way, if you want the posix
behaviour do
        X=whatever; X=$X command
then we know X will be set in the shell later.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]