Linux Shell 入门
Linux shell 入门 By notsobad What is shell? Shell is a program that takes your commands from the keyboard and gives them to the operating system to perform Shell vs GUI sh, bash, dash, zsh What is bash? Bash is the GNU Project’s shell. Bash is the Bourne Again SHell. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. Bash 语法 注释 变量定义以及使用 控制结构 循环 函数 调试 特殊字符 执行方法 Hello world. #!/bin/bash # hello world example. for i in `seq 1 10`;do echo hello world; done variables a=1 b=$a c=$a$b # or c="$a$b" or c=${a}${b} d=$(($a + $b)) echo $HOME env commands shell内置了一些命令,这些命令不需要调用外部程序,如echo, printf, cd, pwd等。 ...