天天看點

[ROS] sh腳本檔案,source : not found問題

建立一個腳本檔案,在首行寫上

#!/bin/bash
           

然後換行,寫上想要source的bash檔案,例如:

source /opt/ros/kinetic/setup.bash
           

然後報錯:

xxx.sh: 3: xxx.sh: source: not found
           

這裡提示source指令沒擷取到。

問題解決:

由于運作sh腳本檔案時用的指令是sh xxx.sh

改為./xxx.sh就行了