Does bash have a way to un-export a variable without unsetting it? Does bash have a way to un-export a variable without unsetting it? unix unix

Does bash have a way to un-export a variable without unsetting it?


export -n FOO

From help export:

Options:

  • -f refer to shell functions
  • -n remove the export property from each NAME
  • -p display a list of all exported variables and functions