Shell.01.shell脚本的格式和执行

1.标明shell类型:

 #!/bin/bash 或 #!/bin/python, etc.

#!/bin/bash #Author: X 
#Date: 2020-02-07 
#Version: 1.0 
#Description: For Shell study

2.更改脚本为可执行:

chmod +x yourShell.sh


3.执行

方式1:

./yourShell.sh

方式2:

bash yourShell.sh
4.远程调用脚本在本机执行
curl http://ip/yourShell.sh | bash
 
原文地址:https://www.cnblogs.com/initx/p/12272476.html