天天看点

[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就行了