Difference between launching a script with ./script.sh and . ./script.sh

后端 未结 2 433
野性不改
野性不改 2020-12-03 16:06

Please tell me what is the difference in bash shell between launching a script with ./script.sh and . ./script.sh?

2条回答
  •  情话喂你
    2020-12-03 16:41

    The first requires the file to have the +x flag set. The second uses the . command aka "source", described here.

提交回复
热议问题