Jump out of loops and function return values
one, exit cycleIn shell programming, there are usually two ways to exit a loop:Contine: Is the end of the execution of the loop, the default is Contine 1, when contine 3 o'clock, then the 3rd layer
use of function functionsDefining functions1)Function name () {......}2)Function name {......}Calling functionsFunction nameYou can also pass parameters to a function by positional variablesExample:Scripting, Implementing directory management
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.Num1=100num2=100if Test $[num1]-eq $[num2]then echo ' two numbers equal! ' Else Echo ' two numbers are
sed means Stream editor used as a filter in shell scripts and makefile is very common Sed not only supports the normal form. It has some other powerful features.Let me give you a sample to see if there is any way to solve it.hello
Shell Overview:The interpreter program between the Linux kernel and the userUsually refers to/bin/bashResponsible for directing to the kernel to translate and communicate user/program instructionsEquivalent to the "shell" of the operating systemHow
Enterprise Shell face question 10: Developing an enterprise MySQL startup scriptDescriptionThe MySQL startup command is:
1
/bin/shmysqld_safe --pid-file=$mysqld_pid_file_path 2>&1 >/dev/null&
The Stop command logic
Used in shell programming to determine parameters within an if statement–b return True when file exists and is a block file-C Returns True when file exists and is a character-D returns True when pathname exists and is a directory-E Returns True when
This article mainly introducesShell8 Types of scriptsstringCutTakeThe method summarizes, each method gives the instance code and the operation result, at a glance, the need friend can refer to the nextstring truncation of Linux is useful. There are
You can often see them in a scheduled task. Examples of our company's planning tasks include:*/2 * * * * * root cd/opt/xxxx/test_s1/html/xxxx/admin; PHP index.php task Testone >/dev/null2>&1*/2 * * * * Root cd/opt/xxxx/test _s1/html/xxxx/admin; PHP
[Email protected] ~]# echo $PS 1 # View the main prompt ~]# echo $PS 2 # View from the prompt ~]# export ps1= ' [\[email protected]\h \w]\$ ' # Set the main prompt (temporary), If you want to permanently
In the course of learning Linux, you may have been exposed to a special symbol, such as "*", which is a wildcard symbol that represents 0 or more characters or numbers. The following Amin the special characters that are commonly used.* represents 0
Shell Authoring Steps:1. Scripting Vim first.sh2. Write the complete test script Bash-n first.sh3. Granting permission chmod +x first.sh4. Execute the script./first.shPS Shell Script Learning first need to understand Linux, system commands and
One, Service for NFS1. NFS is the abbreviation of the network file system, which is the web filesystem. For shared storage between Linux systems, NFS relies on RPC protocol during file transfer or information transfer, RPC idea: A client is a server,
2013.05.10 MyTask 1.2The main program sleep time is divided into several small fragments of time to sleep, to avoid prolonged hibernation can not respond to the system signal in time.2013.05.07 MyTask 1.1After releasing the mytask1.0 version
Background: Documenting the process of deploying a JAR program in a Linux environment1 Deployment Process record 1.1 program structureThe main function here is in the Demrest2.java file.For ease of deployment, do the following two points:1 A
The first question: how can I pull my local warehouse code to the GitHub site?Git push Origin masterwarning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.To Github.com:lanshanxiao/yunweather.git! [Rejected] Master--
In fact, this is very simple, in the Linux server installed plug-in Lrzsz can:Then, if you want to upload something in that directory, we can use the command RZ directly to solve the problem:Then enter:Select the file you want to upload, and the
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