1) Unix command:
Although any Unix command can be used in shell scripts, some more common commands are used. These commands are usually used for file and text operations.
Common command syntax and functions:
Echo"Some text": print the text on
function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must be
Shell basic syntax
Basic shell Syntax:Like advanced programming languages, shell also provides instructions and functions for using variables.For shell, the value of all variables is a string, and the shell program uses $ VaRReference the value
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:
function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must be
--book author Shenmon reprint please specify the source
Content Introduction
Objective
What is a shell?
Our first shell script
Run the shell script
Summarize
Part V Third lesson preview: variable in hand, shell not
1. What is a shell script?It is a scripting language, not a programming language.You can use some logical judgments, loops, and other syntax.You can customize the sub-function, which is a collection of system commands.Shell scripts enable automated
There are multiple shells in Linux, where Bash is used by default. This chapter describes how shell works, shell types, General Shell operations, and bash features. Shell is the interface between the user and the Linux operating system. There are
Shell is the interface between the user and the Linux operating system. There are multiple shells in Linux, where Bash is used by default. This chapter describes how shell works, shell types, General Shell operations, and bash features. Shell is the
The Shell also supports functions. The Shell function must be defined before use.The Shell functions are defined in the following format:Function_name () { List of commands [return value]}If you prefer, you can also add keyword functions to
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.