Bash “如何修复”;无法执行子进程源(无此类文件或目录)";

Bash “如何修复”;无法执行子进程源(无此类文件或目录)";,bash,ubuntu-16.04,Bash,Ubuntu 16.04,在运行驱动程序之前,我正在尝试运行一个脚本,以获取catkin工作区的源代码 这是我尝试运行的bash: #!/bin/bash gnome-terminal -e sudo systemctl start firmwared.service sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone & gnome-terminal -e source ~/bebop_ws/devel/setup.bash rosl

在运行驱动程序之前,我正在尝试运行一个脚本,以获取catkin工作区的源代码

这是我尝试运行的bash:

#!/bin/bash

gnome-terminal -e sudo systemctl start firmwared.service
sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone &

gnome-terminal -e source ~/bebop_ws/devel/setup.bash
roslaunch bebop_driver bebop_node.launch ip:=10.202.0.1

当运行bash时,我无法执行子进程源代码(没有这样的文件或目录)。源代码内置在shell中,因此您必须执行以下操作

gnome-terminal -e 'bash -c "source ~/bebop_ws/devel/setup.bash"'

似乎问题在于引用,应该是这样的

gnome-terminal -e "bash -c 'source ~/bebop_ws/devel/setup.bash;roslaunch bebop_driver bebop_node.launch ip:=10.202.0.1'"

如果要在windows上使用GUI但失败,请使用下一个命令:

sudo apt-get install dbus-x11

它不工作,我得到的[bebop_node.launch]既不是包[bebop_driver]中的启动文件,也不是启动文件名错误,因为它看起来像
gnome terminal-e'bash-c“source~/bebop_ws/devel/setup.bash”“
不正确这听起来更像是您试图运行的setup.bash文件的问题,而不是我试图运行的命令的问题。如果您使用'gnome terminal-e'bash-c“source test.bash”,其中test.bash包含一些简单的命令,那么它应该可以工作。