Bash of the Base Infrastructure Special Sex2
1. provides a programming environment
Program: Instruction + data
program programming Style:
Process: command-centric, data-serving instruction;
Object type: Data-centric, instruction service to data;
2.Shell Program: Provides programming capability to interpret execution
3. How the program is executed:
3.1 computer: Running binary instructions;
Programming languages:
Low Level: Compilation
Senior:
compiling: Advanced language - > Compilers- à Target Code
C, C + +
Explanation: High-level language-à interpreter-à machine code
SHell, Perl, Python
3.2 Procedural programming Languages:
Sequential execution:
Loop execution:
Select Execute
3.3 S Hell Programming: Process, interpretation and execution
The basic structure of the programming language:
Data storage: variables, arrays
An expression
Statement
4.Shell script: Text file
#!/bin/bash
#!/usr/bin/python
#!/usr/bin/perl
Magic Number: Magic Numbers
4.1 To run the script:
1. give execution permission to make file execution through specific file path;
2. run the interpreter directly and run the script as a parameter of the interpreter program;
5. Variables:
Named memory space:
6. Data storage method:
Characters: 110:24 bits (8 bits in one byte)
Value: 110:8 bits (2^8)
Integral type
Floating point Type
7. variables: Variable type
Role:
1>. Data storage format:
2>. participate in the Operation :
1. the range of data represented :
Type:
Character
Numerical
Integral type
Floating point type (how to store, how to run??? )
8. programming Language:
Strong type:
Weak type: Bash
All the data to be stored as characters
Floating-point numbers are not supported:
9. logic operation:
TRue (1), False (0)
And:
1&&1=1
0&&0=0
1&&0=0
0&&1=0
Or:
1 | | 1=1
1 | | 0=1
0 | | 1=1
0 | | 0=0
non- :
! 1=0
! 0= 1
xor:
Short - circuit operation:
And:
The first one is 0, the result must be 0;
The first one is 1, the second must be involved in the operation;
or:
The first one is 1, the result must be 1;
the first one is 0, the second must be involved in the Operation
This article is from the "9470860" blog, please be sure to keep this source http://9480860.blog.51cto.com/9470860/1698978
Shell Basic Features 2