Setting environment variable for one program call in bash using env

后端 未结 4 1803
失恋的感觉
失恋的感觉 2020-12-29 02:41

I am trying to invoke a shell command with a modified environment via the command env.

According to the manual

env HELLO=\'Hello World\'         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 03:06

    Here is an easier way to confirm shell is working as expected.

    env A=42 env
    env
    

    The first command runs sets A to 42 and runs env. The second command also runs runs env. Compare the output of both.

提交回复
热议问题