bash - export doesn't work

后端 未结 1 1875
陌清茗
陌清茗 2021-01-28 17:29

I\'m missing something very elementary. Under Mac OS X. I\'ve tried chmod 0777 setdir.bsh. Must be something wrong with my settings.

#!/bin/bash                          


        
相关标签:
1条回答
  • 2021-01-28 18:20

    export makes the variable available to subprocesses, not parent processes.

    Can you source this file instead ? e.g.

    $ . setdir.bsh
    

    That will execute the file in the current process i.e. the shell itself.

    0 讨论(0)
提交回复
热议问题