Last updated 2 years ago
在脚本开始添加 #!/bin/bash;
#!/bin/bash
执行 chmod u+x $script_path;
chmod u+x $script_path
(可选)添加环境变量,使脚本全局可用,export PATH=$PATH:$script_directory;
export PATH=$PATH:$script_directory
如果不行添加,可以把脚本保存到 /usr/local/bin;
/usr/local/bin