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

Re: POSIX replacement for bash's “export -n” ?



Chris Jackson wrote:

There really doesn't seem to be a way. I can only suggest:

* bolt those comands up into an "unexport" function (not pretty;
   make your "BAR" local and you don't need to subsequently
   unset it)

For reference, this seems to work:

unexport() {
  local unexport_var="`eval echo \\\"\\\$$1\\\"`"
  unset $1
  eval $1='"$unexport_var"'
}

Like I said, not the prettiest thing.

--
Chris Jackson
Shadowcat Systems Ltd.


Reply to: