The For loop works by taking the element one by one of the serial element out, putting it into the set variable sequentially, and then repeating the enclosed command area (between do and done) until all the elements have been exhausted.Where serial
The shell acts as an interface between the user and the kernel in the Linux system, which is used to convert the commands entered by the user into instructions that the kernel can understand, and then to perform the corresponding functions through
The most common Linux commands and toolsDirectory Next document: CD nameReturn to the previous directory: CD.To view and edit a text file:? View files: More, tail? Edit File: VIsuch as scripting. SHVI shell.shTo view system network status:? View
IntroductionBody$?$? is a shell variable that represents the exit state of the last execution command. 0 for success, not 0 for failure. Remember: $? Always indicates the exit state of the shell command after the last execution, and when the
Business requirements: the need to migrate 1000多万个 files from one directory to a remote machineIdea: Use wget to move the file one after another, because the number of files is relatively large, if a bit in the loop operation, it will be very slow.
Parse the scrambled log file into the temp file, then use the AWK1004CD/USR/LOCAL1005LL1006CD pttmsg/ 1007 ll 1008 cd msgbin-2/ 1009 ll 1010 cd proxy 1011 ll 1012 cd log 1013 ll 1014 tail -1000 proxy_sub0_20160107.log 1015 grep ' = = =
The/etc/passwd file contains a list of all system user accounts and basic configuration information for each userUser name: Password: uid:gid: User's full name: User's default working directory: User Default shell programBy default, the bash shell
Common shell variables are: custom variables, environment variables, positional variables, predefined variables, and so on.Variables: Can be stored in a variable value of space, can be changed by different environments, is a variable value. Echo
One. grepgrep (Globally search a Regular Expression and Print) is a powerful text search tool , it can use regular expressions to search for text, print matching rows, but does not affect the contents of the original file , and by the return value
Linux Shell Process Control
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
Skillfully using the delimiter delimiterWhere to enter large pieces of textAutomatic selection and entry of placesAccessing the database[Email protected] ~cat > OUT.txt EOF> 123jl412 3> o> EOFTool Usage TipsUniquely identifiesDate: Creates a log
9 Kinds of interception of strings in shell, take var=http://www.google.com/test/.html as an example(1) Method one: # Intercept, delete the left character, retain the right character.Echo ${var#*//}var is the variable name, and the # is the operator,
Linux There are eight ways to intercept a string. Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character. The code is as follows:Echo ${var#*//}where var is the variable name
Using a shell script to implement a progress barThe code is as follows:650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/DC/wKiom1dirnXDvyV1AAA-ATqC6Jg995.png-wh_500x0-wm_3 -wmp_4-s_4061727919.png "title=" progress bar. PNG "alt="
1. Remove the left character and leave the right character1). Use # InterceptExample: str= "http://www.baidu.com"650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/82/DC/wKioL1djQu_CLXeEAAAzIuXnc10469.png-wh_500x0-wm_3
#!/bin/sh/ETC/INIT.D/SNMPD start && >/dev/nullPid= '/ETC/INIT.D/SNMPD status| grep pid ' # '/etc/init.d/mysqld status| grep "not running" to see if the status of the service is healthy with the status stateIf ["$pid" = = ""]; Then
First question: Recursion and non-recursion of Fibonacci sequencesNon-recursive:650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/82/EF/wKiom1dl-8rD92igAAB-pImrC88891.png-wh_500x0-wm_3 -wmp_4-s_582408408.png "title=" series non-recursive
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