Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 2
    $REPLY is a builtin variable from the shell not environment. for your question try declare -x Commented May 3, 2020 at 19:36
  • 2
    The set command might do what you want. Commented May 3, 2020 at 19:39
  • What is the difference between the an Environment Variable and a shell built-in variable? They are both set by the shell not the user? Commented May 3, 2020 at 19:51
  • Apropos the initial question, set and declare -x seem to be working for me. Thank You Commented May 3, 2020 at 19:56
  • printenv will show all the environment variables that are set in your current shell. It doesn't show all that could be set (you can technically set almost any string as an environment variable). There are a large number that will be set under certain circumstances (e.g. in an ssh session); or that, if set, would have a special function (e.g. the LANG and LC_* variables, which would tell programs what locale to use; see man locale). There are no full lists of those, because anyone who writes a program can make it create/react to any variable they want, thus creating a new one. Commented May 3, 2020 at 20:28