Article title: shell introduction-Preface. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Script language (Scripting language) such as perl, tcl, and PHP3 are the same as C, Jara, and other system programming languages (system
The style of programming langue is completely different, and the scripting language is designed or used to connect things. His use does not depend on
In a fixed type method to achieve more advanced (compared to the assembly machine code), faster program design.
A notable feature of system programming is that "type", an integer, a long integer, and characters occupy a fixed storage unit in memory.
So that it will not be misused, so it is suitable for large-scale program design (because no one wants to generate 10 million lines of program code
And the compiler can use the type information to generate the optimization code.
The scripting language generally has a set of components that have been written in other languages (generally C. The script language will not start from scratch
First, it is combined with the components that have been written. For example, TCL and Kisual Basic can be used to manage GUI components, while UNIX Shell can
Using components as filters to form a "production line" is like glue. Because of this, script language programs are developed rapidly, although
However, the execution program itself is relatively inefficient, but the overall execution time is determined by the component it calls, so the efficiency
The loss is not big. Its own variables are generally considered string types (such as Bash), and are temporarily changed based on the calculation.
The volume type (in this respect, it is somewhat like the C language, but different from Ada), which facilitates simplifying the work of connecting components to make it easier
Combined with components. Obviously, the script language is more flexible than the system language.
Finally, let's compare strong and weak languages:
The following is an example of the tcl painting window:
Button. B-text Hello! -Font {Times 16}-command {puts hello}
Below is a window drawn by C ++ using MFC
CFont * fontptr = new CFont ();
FontPtr-> CreateFont (16, O, 7OO, O, ANSI_CHAREST,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH │ FF_DONTCHRE, "Times New Roman ");
ButtonPtr-> SetFont (fontper)
Even if it is written by the same person, many non-essential information occurs in the source program, which is more difficult to read.
Script language introduction
1: In addition to being a command line, Linux Shell does not obtain any important tools for system management. it is also a good script language.
Currently, the popular shell
Bourne Shell; sh
C shell; csh
Korn shell; ksh.
Tcsh.
Bourne Again shell; bosh.
Linux standard shell is bash, so this chapter will mainly introduce bash and tsch programming
2: Brief History of shell
The first important shell is Bourne shell (the inventor of shell is Steven Bourne), the first popular UNIX in 1979.
The release is, and Bonme shell is used. The first popular shell variant is C shell. C shell
In the bsd unix system, the author is Bill Joy from the University of Berkeley. C shell is mainly because of its syntax and C language
The name is similar. This makes it easy for programmers to learn C shell. The above is the second main shell
Stream, most of the later variants of shell inherit the advantages of these two types of shell, such as Korn, tcsh. and bash.
Bash shell is one of the important tools and software of the GNU program, and is also the standard shell in the GNU operating system. Bash is compatible with sh,
Therefore, many early-developed Bourne shells can continue to run in bash. Bash was born in 1988.
The author is Brian Fox and Chet Remey joined in 1989. now the official maintainer is Chet Ramey.
Tcsh is an enhanced version of csh. it was transplanted to the same platform since 1987.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service