UNIX, get environment variable

前端 未结 7 821
滥情空心
滥情空心 2020-12-30 18:41

I have a ridiculous question due to a ridiculous problem.

Normally if I want to get the contents of an environment variable in UNIX shell, I can do

         


        
7条回答
  •  我在风中等你
    2020-12-30 19:26

    The solution really depends on what the restrictions are why you can't use a simple $VAR. Maybe you could call a shell that doesn't have the restrictions and let this sub-shell evaluate the variable:

    bash -c 'echo $VAR'
    

提交回复
热议问题