shell基础
1.声明bash脚本 #!/bin/bash
一个简单的例子 scp1
#!/bin/bash
who
pwd
date
2.运行bash脚本
2.1 /bin/bash scp1
搜索路径(PATH变量)中包含了/bin目录的话,可以简单使用bash命令(eg: bash scp1),而不是/bin/bash
2.2 ./scp1
使用chmod u+x scp1 为scp1设置合适的权限
1.声明bash脚本 #!/bin/bash
一个简单的例子 scp1
#!/bin/bash
who
pwd
date
2.运行bash脚本
2.1 /bin/bash scp1
搜索路径(PATH变量)中包含了/bin目录的话,可以简单使用bash命令(eg: bash scp1),而不是/bin/bash
2.2 ./scp1
使用chmod u+x scp1 为scp1设置合适的权限