1. Linux Scripting Basics
1.1 Basic Introduction to grammar
1.1.1 Start
The program must start with the following line (must be on the first line of the file):
#!/bin/sh
The symbolic #! is used to tell the system that the parameters behind it
1. What is shell?
In fact, I have heard of shell before I came into contact with Linux. At that time, I was talking about shell programming and I knew nothing about it. But surprisingly, I remember this term when my memory is really bad. Okay,
Shell:An interface program that completes interactive operations between the user and the operating system, providing users with simplified operations; In the 70 's mid-century in Bell Labs, Bourne bit UNIX developed a shell program Bourne Shell,
Xi. functionsThe shell function is defined by the description of the shell grammar above and holds a series of commands waiting to be executed later. When the shell function name is used as a simple command name, a series of commands associated with
Jun 11,201 0 by Mitch frazy in
How-tos
If you 've used the command line much at all you know about I/O redirectionfor redirecting input to and/or output from a program. what you don't see all that often or that you may not be familiarwith is
1. Basic Concepts
A, I/O redirection is usually related to FD, Shell FD is usually 10, namely 0~9;
b, commonly used FD has 3, for 0 (stdin, standard input), 1 (stdout, standard output), 2 (stderr, standard error Output), the default and keyboard,
1 shell overviewThe shell is a command interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program. The user can start, suspend, stop, or even write some programs with the
1 shell overviewThe shell is a command interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program. The user can start, suspend, stop, or even write some programs with the
Directory
Directory preface software Environment Knowledge Subprocess Popen Constructor constructor Class Popen parameter args calling program call shell instruction Stdinstdoutstderr real-time fetch subroutine output one time get all output of
> and when it comes to I/O redirection, let's get to know file descriptor (FD) first. The operation of the program, in most cases, is the processing of data (data), which is read from where? And where to send it? This is the function of file
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.