The idea of writing a Shell in Linux-general Linux technology-Linux programming and kernel information. For details, refer to the following. Compile a Shell that can run in Linux
First, you must understand that Shell is a command interpreter. The
Quote Article a:http://blog.csdn.net/liang13664759/article/details/1771246Article Introduction: Very detailed article, the explanation is the comparative basic knowledge.This article may continue to update some of the cited articles. But the blog
In makefile, functions can be used to process variables, making our commands or rules more flexible and intelligent. Make does not support many functions, but it is enough for us to operate. After a function is called, the return value of the
Table 1-6 common command line options of the GNU make command
Definition of command line options-C dir changes to the specified directory DIR before reading makefile.-F FILE uses the specified FILE as the makefile.-H: all make options are displayed.-
In makefile, functions can be used to process variables, making our commands or rules more flexible and effective.Smart. Make does not support many functions, but it is enough for us to operate. After the function is calledThe Return Value of the
In makefile, functions can be used to process variables, making our commands or rules more flexible and intelligent. Make does not support many functions, but it is enough for us to operate. After a function is called, the return value of the
Defining functions in shell can modularize the code and facilitate code reuse. However, the scope of the variables in the script itself and the variables in the function may be confusing to you. Here, let's take a look at this issue.
(1) The
EMACS
If Bash finds that the value of this variable is 'T' in the environment when the shell is started, it considers that the shell runs in the Emacs shell Buffer and does not allow row editing.
ENV
Similar to BASH_ENV, it is used in shell
The Shell also supports functions. The shell function must be defined before use.Definition and invocation of a functionThe Shell functions are defined in the following format:Function_name () { List of commands [return value]}function return
which command
The purpose of the which command is to search for the location of the executable file in the path specified by the PATH variable. It is generally used to verify that the specified software is installed on the
Transferred from: http://codingstandards.iteye.com/blog/831504Description of UseThe type command is used to display the types of the specified command. The type of a command can be one of the following
Alias aliases
Keyword keyword,
Using functions————In makefile, you can use functions to manipulate variables to make our commands or rules more flexible and intelligent. The functions supported by make are not much, but they are sufficient for our operation. After a function call,
As a regular script operators, can find a problem, many times we are in different scripts to repeat the same piece of code. For example, we are going to use regular expressions to determine the legality of IP address, if each time to write the
Shell Script BASIC Programming fourth articleMain contents of this chapter: functionsFunctionfunctionfunction name {command;} or name () {command;}Defines the Shell function.Create a shell function that is named name. When enabled as a simple
1. PrefaceAlmost half a year did not write a blog, wasted a long time, work in the chores too much, their own more and more lazy. In order to spur their own growth, or to insist on writing a blog, record their growth.2. Shell Function
You can use the Remove () function in the CFile class to delete a file while you are doing a file operation, but such an operation will permanently delete the file, and you cannot recover it when necessary. The only way to solve this problem is to
First, define the shell function (define functions)
Grammar:
[Function] funname [()]{Action[Return int;]}
Description
1, can be defined with function fun () or directly fun (), without any parameters.2, the parameter returns, may display adds:
1. Preface
Almost six months did not write a blog, deserted for a long time, the work of the chores too much, their own more and more lazy. In order to spur their own growth, or adhere to write a blog, record their growth.
2. Introduction to Shell
It's time to enter the fourth chapter, just see a post title: I have a good talent, but unfortunately I am a girl. Khan ~ this ... Music Without Borders, this should not have no gender sector?
Fourth Chapter Text Processing tools
The book first
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.