Linux shell directives such as-D,-F,-e are judged by :File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file
Shell programming is designed to simplify management operations。1、base variable and variable classificationbase is the standard shell for Linux。Base VariableSet:querying all environment variables under the systemEnv: view environment variables under
Task handover, different systems, versions, and shells may not be the same. Some time ago to help a friend to engage in centos5.9, ya ya the use of incredibly is sh. It's crazy! Make a brief summary.View the shell supported by the current
Do you write a shell that is encrypted in the production environment? Anyway, I do not, the online environment to see the Bai, feel nothing. In fact, it seems that there are several benefits.1, simple encryption, to prevent others from looking
Parameter extension:1. The parameter referenced by the name is called a variable2. Parameters referenced by numbers are called positional parameters3. Parameters referenced by a particular symbol have a special meaning and purpose, and are referred
To use a good bash shell, first of all to understand the bash shell environment configuration, only the configuration, we will be handy, to configure, we must understand the type of bash configuration file, and then according to the actual needs to
functions: Function functions are statement blocks consisting of several shell commands for code reuse and modular programming1) Definition of function:Can be defined in the command line, part of the script, only in a separate file of the
I. Condition testing: Test [The command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the
First, Shell special variables1. Position Variables
Positional variables
Meaning
$
Gets the file name of the currently executing shell script, including the script path
$n
Gets the nth
Overview:Statement control for Shell scripts-There are three processes in the process programming language mentioned earlier:Sequential execution: Executed in the order of a single statement;Select execution: Select execution according to the
For loopFor variable name in list;Loop bodyDoneImplementation mechanism:Assigns the element in the list to the "variable name" in turn; The loop body is executed once each assignment; Until the elements in the list are exhausted, the loop endsList
To understand positional variables, first you need to know what a variable is.A variable is a particular string that represents something that is not fixed, and simple to understand is to replace another complex or volatile data with a simple "word".
Shell script ProgrammingThe history of programming languages: Machine language--Assembly languages--high-level languagesCategories of programming languages:(1) According to the operating modeStatic language: Compiled language, pre-converted to
condition Test1. Condition testing: Test [The command test or [can test if a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false,The exit status of the command is 1 (note the exact opposite
How to let awk use Shell variables under LinuxWhen we write shell scripts, we typically include other small programs or commands in the script, such as awk operations. For awk , we need to find some way to pass some values from the shell to the
Condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical
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