Use the script one-click to install mysql5.7.x and initialize the database. Start database----MySQL version number: source code mysql5.7.10linux version number: centos6.5 X86_64#!/bin/bashgroup_name=mysqluser_name=mysqlmysqldb_home
1. Special symbolsFor more information, see2, about the pipe character(1), cut split-D delimiter-F Specify segment number-C to specify the first characterFor example, see,Example, | Output, cut splits out the desired results later. In general,-C and-
The wildcard asterisk number (*) represents a question mark (?) that matches 0 or more characters. Represents a matching single character in parentheses number ([0-9]) that represents a single digit character between matching 0~9 brackets plus the
Receiving user parameters#./example.sh One and threeThe Shell scripting language includes variables for receiving user parameters, and based on the above command, the commonly used variables are as follows:
Use $ A To get the file name of
First, the purposeWrite a script to get the size of all the files and folders in the specified directory. The style of the output isLS-LHcommand is the same.Command execution example, where andLS-LHThe only difference in command output is the size
LNMP stands for: Linux system nginx+mysql+php this site server architecture. LNMP is now the most large companies in the Web environment, Nginx Small and efficient Web server and reverse proxy server, compared to Apach occupies less resources, more
One, free of dense interaction--stdin1. Reading strings from standard inputsuch as: passwd--stdin heruguo246[Email protected] mnt]# passwd--stdin heruiguo246Changing password for user heruiguo246.123456 ---Input modified heruiguo246 user password is
Important notes about the function:When executing the Shell function, the function name and the parentheses after the function name are not required;The definition of a function must be defined or loaded before the executing programThe execution
about the futureAnd is she really human?She ' s just so something newA Waking Lithium flower --"Lithium Flower" in The depicted by Ghost in the Shell, mankind and machinery is combined. Cyborg, refers to the human organ that
There are three standard input and output in Linux, namely Stdin,stdout,stderr, the corresponding number is 0,1,2.STDIN is a standard input that reads information from the keyboard by default;STDOUT is the standard output, by default output output
First Category: Digital cycle-----------------------------for1-1.sh#!/bin/bash for ((i=1; i; i++)); do Echo $ (expr31); Done -----------------------------for1-2.sh#!/bin/bash for with $ (seq1) do Echo $ (expr31); Done --------
Shell script is similar to batch processing under Windows/dos, that is, the use of various commands pre-placed into a file, convenient one-time execution of a program file, mainly for the convenience of administrator settings or management. However,
8.1:shell Introduction:The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, supports logical judgments, loops, and each user can have his or her own shell:The CentOS default shell
1. Receive the user's parameters:In order to give the user more flexibility to complete the work requirement, the shell script can pass parameters when executing the command: (command name parameter 1 parameter 2 ... )Shell pre-defined variables:$ $
functionThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.Format: function F_name () {Command}The function must be placed first, and the
Shell: Shell Process Control details, shell Process Control detailsShell: Shell Process Control details if else
If statement
Syntax:
if conditionthen command ...fi
Eg:
#!/bin/basha=100b=100if [ $a == $b ]then echo "$a == $b"fi
Output:
100 ==
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