Keywords: Linux, Shell
How do I run a shell script without using "sh" or "bash" commands? - Stack Overflow
- 在脚本开始添加
#!/bin/bash; - 执行
chmod u+x $script_path; - (可选) 添加环境变量, 使脚本全局可用,
export PATH=$PATH:$script_directory;如果不行添加, 可以把脚本保存到
/usr/local/bin;