UNIX, get environment variable

前端 未结 7 801
滥情空心
滥情空心 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:08

    ( set -o posix ; set ) | grep $var
    

    search for all unix-compatible format variables been used

提交回复
热议问题