A variable is a quantity whose value can vary; In essence, a variable name is a memory space for storing data;The variables have local variables and environment variables;A shell variable is a weakly typed variable that does not need to specify its
Recently in the Zabbix, the company has six new servers. When the Zabbix client is deployed, the baby is really angry. Grandpa's always so repetitive work is also not AH. But as a war five slag, what else can be mixed with rice? Think of last year
Recently in the Zabbix, the company has six new servers. When the Zabbix client is deployed, the baby is really angry. Grandpa's always so repetitive work is also not AH. But as a war five slag, what else can be mixed with rice? Think of last year
Shell programming-------------------lt//less than -GT//greater than >=//equivalent-eq//equals=$#//extract number of parameters$//First parameter$n//extraction of nth parameters$//extract command$? //Store The result of the last execution command, 0
1. Backgroundthe role of the shell is to explain the execution of the user's commands, the user enters a command, the shell interprets the execution of one, which is called Interactive (Interactive), and the shell has a way of executing the command
Quotation marks are often used when writing shell scripts, and sometimes the difference between single and double quotes is always forgotten.So just tidy up for the future when the brain is not good to come to review. First, what they have in
Calculate the sum of the 1~100 of the word:
Require the accumulation of numbers, you can use the loop to complete, the following code:#!/bin/bashsum=0str= "" #for i in {1..100}for ((i=1; iTo run the script:650) this.width=650; "src=" Http://s2.5
Custom variables: There are variables that are defined by the system user, only valid in the user's own shell environment, also known as local variables, and when shell scripting is programmed, certain custom variables are usually set to suit the
The shell supports only integer operations. Typically let, expr, declare, $[] are implemented.More accurate calculations suggest using the BC tools under Linux-a high-precision computing language.1. let is a shell built-in integer operation command#
a,[] single and double bracketsBasic elements:[] Two symbols should be separated by a space aroundThere is a space between the internal operator and the action variable: such as ["a" = "B"]String comparisons in,> \ [] in the string or ${}
The first four methods are to remove some characters, and the last four methods to preserve certain characters1, # Intercept, delete the left character, retain the right charactervar= "Hello World"Echo ${var#*l}Results:Lo Worldwhere Var is the
Double quotesPurpose: In order to contain text or function segments. In addition to itself, the function inside the counter-quote, the variable starting with $ and \ Start the inverse of the character outside, the rest are directly output.The
Refer to "Linux command, editor and Shell Programming" (Tsinghua University Press)When you start the shell, it runs the startup file to initialize itself. Which file to run depends on how the shell interacts with a login shell or a non-landing shell
Guide
Unlike the Java, PHP, and other languages, the Linux shell has its own process control statements, including conditional statements (IF), loop statements (for,while), and SELECT statements (case). I'll use the example below to illustrate
First, the basic use of EvalEval will scan the back of the CmdLine two times, if after the first scan, cmdline is a normal command, then execute this command;If the cmdline contains an indirect reference to a variable, the semantics of the indirect
Thank you for the 36,000 sectionCommon Shell Categories:
BASH: is the GNU Bourne Again Shell, which is the default shell on the GNU operating system
C Shell: The BSD version of Sun's shell
Look at where the shell is on the
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
Shell: Explain the execution of user input commands, row by line interpretation, can also batch many instructions, you can write all these instructions into a script file, let the shell execute multiple commands at once, the common shell (bash, it
Yesterday, the Dragon Boat Festival, the evening when a phone call, my friend's company, the database was two work not long phper to break, the specific is to put a field value, to the whole table into a name, of course, this is can be configured to
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