#!/bin/bash    (固定开头)

# 注释(脚本中)

cat   1.sh  查看脚本

1.执行脚本

  1)先给脚本执行权限

    chmod   744  1.sh      或     chmod   +x  1.sh 

  2)执行

  ./1.sh     (./当前路径)

2.赋予权限直接运行

  chmod   a+x   first.sh

  ./first.sh

3.通过bash或sh运行脚本

  bash  first.sh

  sh  first.sh

4.通过 . 或source运行脚本

  source   first.sh

   . first.sh

 

posted on 2017-10-12 22:52  飘曳残生  阅读(103)  评论(0编辑  收藏  举报