1. 程式人生 > >linux指令碼 source: not found

linux指令碼 source: not found

在Ubuntu 當中 執行指令碼預設的使用的是dash,而非bash,執行能力較弱,

例如1.sh

#!/bin/sh

source /etc/profile 

輸出:source: not found

2.sh

#!/bin/bash

source /etc/profile 

正常執行

3.source等價於 .

所以使用. /etc/profile都會執行正常 (注意點號後面空格)