Date:        Wed, 24 May 2017 15:40:07 +0200
    From:        Joerg Schilling <joerg.schill...@fokus.fraunhofer.de>
    Message-ID:  <59258d37.h5t6p4p9cd52ubz7%joerg.schill...@fokus.fraunhofer.de>


  | If you later assign a value to that variable, the "export FOO"
  | command just sets up the export property but does not put the variable
  | into an unset state.

  | This looks like a conceptional POSIX bug.
  | 
  | Jörg

This is what POSIX actually says about this (I manually wrapped long lines)

76851 2. Variables that were unset at the time they were output need not
         be reset to the unset state
76852    if a value is assigned to the variable between the time the state
         was saved and the time at
76853    which the saved output is reinput to the shell.

That is, this is a known issue, and the way it was shown to work is the
way it is known it will work.    If you really need to restore unset
variables back to unset state, you also need to save the output from "set"
and read that in conjunction with the export -p output, and unset any
variables that export mentions that set did not.

There is a similar issue with the "trap" command, except that one really
is not noted in the standard.

kre


Reply via email to