Your question is unclear, and the concept of variable (and of environment) is very different in C, in bash, and in Scheme or Python or Javascript.
You might want to become familiar with some Lisp or Scheme (e.g. read SICP) then read Queinnec's Lisp In Small Pieces (explaining in great details about Lisp interpreters & compilers). Read also Scott's Programming Languages Pragmatics. Then you'll get a broader view of the notion of variable (and you might study the operational semantics and/or the denotational semantics of some programming language).
First, C is a low-level language. It has pointers, pointer arithmetic, address-of operator (unary &
). Its variables exist only at compile time (at runtime, there are mostly locations in the store -e.g. in heap or on the call stack or in global data segment). Look into ACSL for describing incompletely some specification of the behavior of some C functions.
On Linux, you could get the address of a global variable or function from its name using dlsym(3), and you might get the name of a global variable or function from its address using dladdr(3)
Read also about homoiconic languages (which C is not) and reflection (which C has not) and type introspection (which C has not; but see RTTI in C++).
Some programming languages (but not C) are expliciting & reifying their environments (mapping variables to values) and their continuations. In standard C, the call stack is not inspectable or introspectable (and that would be useful for garbage collection). See GNU libc backtraces functions (they cannot be written in portable C). Scheme has call/cc.
Notice that a language with introspectable call stack could be compiled into C or into C++ (see my MELT DSL as an example), essentially by reifying each call frame into some local struct
....
Read also about the halting problem and Rice's theorem. There is a intrinsic limitation in what optimizing compilers or static program analyzers can achieve (copied from this other answer of mine). See also J.Pitrat's blog and books about metaknowledge and reflexive/introspective Artificial Intelligence systems.