Home > OS >  The Linux foundation shell foundation 1
The Linux foundation shell foundation 1

Time:10-28

The shell foundation 1
Shell is interpreted language script performs a line to explain a line there is a big role in Linux
The first shell program
#!/bin/bash
Echo "Hello World!"
If statement
The if condition is true under a code execution
The condition is false to perform the else

Fi

The else
The condition is false to perform here
Fi

Multi-branch
If conditions then
Code1

The else
Codn2
If conditions then
Codn4
Fi
Command execution state can become his condition
Echo echo
Variable called
$variable name or the $/variable name
Shell is commonly use sh at the end of the
Bash script execution path
- n did check script syntax error
- x debug script
Assignment execute permission
Use relative path or absolute path
"" strong reference
'a weak reference
` ` reference the results
$with
| | or
& & not
!
Command execution state
0
1-255
Shell arithmetic
Let the var=arithmetic
$(arithmetic)
$((arithmetic))
- */take over % + addition, subtraction, multiplication, and division ", "
The exit out of the shell
  • Related