首页 > 课堂 > 技术开发 > 正文

shell入门

2020-05-27 13:12:08
字体:
来源:转载
供稿:网友

   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;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表