shell执行sh

假设我们有一个名为 “shell_script” 的脚本文件,文件内容如下
#!/bin/bash
然后我们准备执行这个文件
$ chmod u+x shell_script
$ ./shell_script
当我们执行 ./shell_script 这行命令的时候由于脚本添加了 shebang,相当于在命令行这样执行:
/bin/bash shell_script

 

 

#!/usr/bin/bash
cd /data/ && 
rm -rf openpilot && 
git clone https://mirror.ghproxy.com/https://github.com/dragonpilot-community/dragonpilot -b d2 --single-branch --depth=1 openpilot &&
touch /data/data/com.termux/files/continue.sh &&
echo "#! /usr/bin/bash" >> /data/data/com.termux/files/continue.sh && 
echo "cd /data/openpilot" >> /data/data/com.termux/files/continue.sh &&
echo "exec ./launch_openpilot.sh" >> /data/data/com.termux/files/continue.sh && 
chmod u+x /data/data/com.termux/files/continue.sh && reboot

posted @ 2024-03-19 19:08  很多无尾熊  阅读(22)  评论(0编辑  收藏  举报
本站已运行[ ]
正在加载今日诗词....