当前位置: > shell编程 >

shell入门

时间:2014-11-27 12:17来源:linux.it.net.cn 作者:IT

     shell脚本一般有3种执行方法:

  1. bash直接执行

  >bash myshell.sh

  2. 重定向执行

  3. chmod添加可执行权限执行

  >chmod +x myshell.sh

  >./myshell.sh

  shell脚本开头一般为:

  #! /bin/bash

  表示这是一个用bash解释执行的脚本

  一个最简单的shell脚本一般如下:

  #! /bin/bashecho This is the first bash programcal;echo Show all programps;

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容