1. Create shell script file Create file, add executable permission to file chmod +x file format: Specify the shell #! in the first line of the file /bin/bash NOTES: #开头的命令 (except #!/bin/bash in the first line) Display message:
== : Two strings are equal! =: Two characters not equal> : Whether a string is greater than another string : Whether a string is less than another string- N String : Tests whether the specified string is empty- s string : Tests whether the
Use of arrays$array _var= (1 2 3)--use parentheses to define an array with a column value$echo ${array_var[0]}--The first element of an array$array _var[0]= "Zero"--defines an array using the form of an index and a value$echo ${array_var[@]}--Print
Condition test Type in Bash script: integer testString testFile testExpressions for conditional tests: [Expression][[expression]] expression must have a space before and after itinteger test :-eq: Tests whether two integers are equal and equal to
Shell scripting, there are three kinds of control structure are: sequential structure, conditional judgment structure, loop structure. This article summarizes the use of conditional judgment constructs in shell scripts.The structure of conditional
Shell scripts can also receive script parameters, like commands and applications, as they are executed .An application example:VI addhead.sh:Suaddhead ns=591 $Perform:./addhead.sh Rtm_step10_lap.dat rtm_step10_lap.su (where rtm_step10_lap.dat is
The test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file.
Numerical test
Parameters
Description
-eq
Equals is True
(1) rsync (remote synchronize) is a data synchronization tool that allows you to quickly sync files between multiple hosts via Lan/wan, or use rsync to synchronize different directories on your local hard drive. (2) Rsync is a tool for replacing
This morning a friend suddenly QQ asked, shell programming function why return can only be an integer, how to return the execution of the function and save to a variable. In fact, this problem is very good to solve---only need to seriously
Shell Foundation-environment variable configuration fileSource configuration file or. Configuration file:After the environment variable is written to the configuration file, the user needs to re-login to take effect, but with the source command, it
One: Linux shell string interception and splicingSuppose there is a variable var=http://www.linuxidc.com/123.htm 1 # Intercept, delete the left character, and leave the right character. Echo ${var#*//}where Var is the variable name and the # is an
1. First, log on to the remote Linux server, such as 192.168.127.222, with the normal password login method;2. Click the Key Generation Wizard in the tool:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/67/wKioL1YcmyPy22e-AAI3RPggo2A573
Transfer from http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.htmlThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop
Linux Login Server Knock command too much, at some point it is inconvenient, so the shell wrote aI. Description
Supports both secret and key formats
The user name and password are both written and saved in clear text
Two. Configuration
FunctionFunctions have the same functionality:Simply put, the function of the program is to call the same part of the code in a number of parts, and then a name, so the function is called the name can be, in the modification of the code, only need
Bash of the Base Infrastructure Special Sex21. provides a programming environment Program: Instruction + data program programming Style: Process: command-centric, data-serving instruction; Object type: Data-centric,
1.shell OverviewThe shell is a command-line interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program, and the user can start with the shell, suspend, stop, or even write
This article is intended to review the definition and assignment of arrays in shell script programming, to read arrays, and to get the length of an arrayKnowledge Reserve
Array : Multiple contiguous separate memory spaces, each memory
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