Original address: http://blog.chinaunix.net/u/21908/showart.php?id=1420565 reference
* Learn Bash Shell 3rd edition 6.4. Arrays
You can also use array variables in Bash, which are assigned two types of values:(1) name = (value1 ... valuen) at this
Using the process and runtime two classes, the return value is obtained by the getInputStream () method of the Process class[Plain] View plain copy package ark; import java.io.bufferedreader; Import java.io.IOException;
When writing scripts in Linux, there is always the need to determine whether the existence of files, the contents of the file is empty and so on, and these operations can be implemented with the test instructions, through the man test instructions
1. String judgment
STR1 = str2 When two strings have the same content, the length is true
STR1!= str2 is true when strings str1 and str2 are unequal
-N str1 True when the length of the string is greater than 0 (string not empty)
-Z str1 True when
Well, it's purely memo-type.
1. Install peanut shell and register a free domain name.
2. The network environment determines the future operation
① If your machine is connected directly to the extranet, the router is not used, so you can use it.
②
Recently in doing the server, because it is all-weather operation, the server is not said to be absolutely stable, never crash never crashed anything, so even if the downtime does not matter, the key is to be able to start in time, can not affect
1. Sometimes operation and maintenance requirements automatically generated Cronab task scheduling, the implementation of the corresponding service name management; #!/bin/bash#athor check crontab crontab_ Add () {cron_path= "$" cat >/etc/cron.d/$
First, regular expressionA, the basic regular expression
Meta character
Description
.
Match any single character
*
Match any of its preceding characters any time
.*
Var=value//This is a value assignment.Note that there is no space between the variable and the value, otherwise it will be considered equivalent judgment, such as [var = valu E]//equivalent judgment, the space is particularly important!!!#!/bin/SHCD
1.shell is a batch program, similar to the Windows BAT file2. When writing the shell, the first line should be #! /bin/bash begins Execute the file using the bash shell.3. Use the # comment (preferably note the function of the shell script in case
A 1.shell programming language is a dynamic language (a weakly typed language) that interprets side execution at run time, does not need to be declared before it is used, is declared in use, and does not even differentiate between variable types,
If...elseif [$1x = = "AB" x]; Then echo ' You had enter AB ' elif [$1x = = ' CD ' x]; then echo ' You had enter CD ' Else echo ' You had enter UNEXPE CTED word "fi Case...esacA switch case similar to another language, however, here is a
Shell and shell scripting differencesShell: Refers to an application that provides an interface through which the operating system kernel services can beShell script: A script written for the shellExecution of Shell scriptsPass./execute instead of
Turn from: Https://www.cnblogs.com/vijayfly/p/6234575.htmlshell redirect standard error output to a different locationThe following forms of command invocation can often be found in some scripts, especially when Crontab is called:/tmp/test.sh
8th Shell Programming Character Menu ManagementI. Shell function definitionFunction menu () {Echo ' This is a func!! ';}Two. Shell functions useMenuThree. How to use the Cat command HeredocCat
2. MacOS does not support ll (need to use LS-L implementation), in fact ll under Linux is ls-l shortcut keys.LS Displays the file in the current directory.LS-L Displays the file details in the current directory.#以下命令均不包含 ".", "..." Directories, and
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