linux - 如何添加 shell 脚本中包含的标志?

标签 linux shell raspberry-pi gradlew autostart

我想将 myScript.sh 设置为自动启动。

我已经设置了配置。

chmod +x /etc/init.d/myScript.sh

并启用它

sudo update-rc.d /etc/init.d/myScript.sh defaults

但是当我运行 myScript.sh 时,由于标志 -bootRun,我收到错误。 myScript.sh 看起来像这样:

sudo /home/pi/path/to/my/program/gradlew -bootRun

我怎样才能运行这个脚本?

编辑:

我听下面那个人的讲话。我将代码放在 Raspberry 中 /etcrc.local 中。

enter image description here

但是当我运行时出现此错误。为什么?

enter image description here

enter image description here

enter image description here

最佳答案

这是解决方案。感谢上面的其他人!

enter image description here

关于linux - 如何添加 shell 脚本中包含的标志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58495008/

相关文章:

arm - linkscript - 不同的链接地址和加载地址

c# - 如何在 Raspbian 操作系统启动时启动 Mono 程序?

linux - BT设备树莓派不配对获取蓝牙信号强度

C控制台应用程序可以同时在Linux和Windows上运行吗

java - 如何在 Linux 上使用 Java 访问智能卡?

python - 在 Ubuntu 10.04 中安装 Dropbox python SDK

带有 IF ELSE 语句的 BASH Shell 无限循环

linux - bash 脚本 - 执行 find 命令没有输出

linux - Virtual Box 和 Windows 7 主机的 Gvim 重绘问题

bash - 当使用空参数运行 grep 时,为什么 "while read"循环会停止?