Often toss WordPress friends will usually build a local environment, debugging finished and then released to the line, as to how to install in the local WordPress, this can refer to my previous write a "relaxed 10-step local installation of
This article mainly introduced the shell in the For loop summary, this article explained in the shell for the loop usage, the shell for the loop's several methods and so on content, needs the friend to be possible to refer to under
About the shell
In development, we often need to change the N-file encoding, ICONV can only make changes to a single file, how to do? Let's write a shell script to solve this problem.
Example one: Using shell script to implement bulk transcoding operation.
#!/
The test command in the shell is used to check whether a condition is valid, and it can be tested in three aspects, such as numeric value, character, and file.
Numerical test
Parameters
Description
-eq
is equal to
Wrote a shell script, can be used to count the daily access log, and sent to the e-mail to facilitate daily understanding of the site.The script counts:1, the total number of visits2. Total Bandwidth3. Independent Visitor Volume4, access to IP
Renames the current directory's image file in a specific format, as follows:
Copy Code code as follows:
#!/bin/bash
#Filename: rename_photo.sh
Set-x
Count=1
For IMG in *.jpg *.png
Todo
new=image-$count. ${img##*.}
MV
Some arguments are used in the Bash Shell,
$1,$2,... A specific number of parameters, the name of the currently executing process name, the script itself, or the whole row output in a regular expression
$# the command line or the number of
#!/bin/bash while
read line
do
#杀掉所有的python程序.
Killall python2
#用读取到的行的参数作为输入执行 *******test.py python program and records the result to a file in the row's parameter 110ut, which is a row parameter
"Variables and Constants"
Variable: The amount that will change, temporarily storing the data so that you can call it later
Constants: Quantity that does not change
One, variable and array
"Variable", like in memory to divide a space, you can
For a long time did not give the VC knowledge Base to press, really embarrassed, because the previous period of time is too busy so there has been no time to write something, there are many friends to me to discuss the issue, I am grateful to all of
One, analysis Apache log
1, there is a document SHELL.SH, the contents are as follows:
[Root@test3root] #catshell. sh
Http://www.baidu.com/index.html
Http://www.google.com/index.html
Http://www.baidu.com/get.html
Http://www.baidu.com/set.html
This article mainly introduces the basic syntax of if and common judgment usage in the shell, this article explains the basic syntax of IF, the judgment of the string, the judgment of the number, the judgment of the file attribute, the logic
Bash's script preliminaryShell script: Another form of preserving historical commands;Shell script Programming:What do you mean by programming?Write the program source code.In order to enable users to use the computer, you can let the computer do
-e file If file exists, true-d file if file is a directory, true-f file If file is regular, true-l file if file is a symbolic link, true-r file if file is readable, true-W file True-X If file is writable, or true-s file if files are executable or
First, the environment ubuntu14.04 x86_64Second, string manipulation 1. get the string length Strlen () similar to the C language${#variable_name} Eg:$name =zhangsan$echo ${#name}8$2. String ExtractionSimilar to substring () in Java${variable_name:
https://docs.mongodb.com/getting-started/shell/query/OverviewYou can use the find () method to issue a query to retrieve data from a collection in MongoDB.All queries in MongoDB has the scope of a single collection.Queries can return all documents
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of
The shell quotesin the the shell often uses single quotes, double quotes, back quotes ( keys above the Tab key in the keyboard), backslashes ( meaning of some Shell metacharacters). If we sometimes want the echo command to output a character that
Shell commands are generally divided into built-in (self-contained) and exotic (except those that come with the Yum installation later)How to produce a built-in command: $ man Bash 1 (why add a 1 here because of the manual format)The composition of
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