shell

目录

  shell

  shell IDE

  shell 解释器

  shell 环境

  shell 注释

  shell 脚本执行

shell 

shell是C语言写的程序,用来沟通linux的桥梁,shell是一种命令语言也是程序语言。

shell是一个应用程序,打开程序界面,通过界面来访问操作系统内核服务

shell IDE

shell IDE 使用VSCode。VSCode 插件:BASH IDE 用于跳转

shell 解释器

1. bin/sh

2. bin/bash(常用)

shell环境

和其他语言一样,需要能够编写代码的文本编辑器和一个能执行shell脚本的解释器。

shell 注释

1. 单行注释

#! /bin/bash

# author: zsh  # "#"注释
echo "hello world"

2. 多行注释

#! /bin/bash

:<<!
author: zsh
create time: 2021/3/23
!

echo "hello world"

shell脚本执行

1. 创建一个脚本

vim test.sh
# file content
#! /bin/bash
echo "hello world!"

2. 两种执行的方式

2.1 作为可执行的程序

# chmod +x test.sh
# ./test.sh
hello world!

2.2 作为解释器参数

# bash ./test.sh
hello world!

  

 

 

  

posted @ 2021-04-21 16:24  zhuang6  阅读(76)  评论(0编辑  收藏  举报