1.source commandAfter you modify the configuration file, you must log off and re-login to take effect, using the source command can not re-loginSource Configuration file. Configuration fileThe environment variable configuration file is primarily
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
* matches any character of any length? Match any single character[0-9] Match all numbers[] matches any single character within the specified range[^] matches any single character outside the specified range[WXC] matches any one of the characters in
Yes, this is a simple script, do not write do not know, write to find out how many shortcomings.The following script is mainly used to bulk add the user's script, originally very simple script, but added some judgment, to verify their own learning.1.
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 ' = = =
IFS is the split symbol, the AA BB cc DD separately is $ $ $ $, when i=3, assigned to B DD. [[email protected] test]# cat 1#!/bin/basha= "AA:BB:CC:DD" ifs= ":" I=0for B in $A;d o [$i-eq 3] & & b= $B; Let i++;d One;echo $b; [[Email
SedSED: it is called a streaming editor, and its working scenario is typically in the editor, where a piece of text is read in the SED in a row and then output in the specified way, which is its most basic usage.First, the basic operation of
Little brother just contact Linux, a lot of things on Linux is more unfamiliar, so write a blog, as their work summary and technology accumulation bar, but also spur their efforts to learn.The reason for today's title is to put Export,source, Bash's
#!/bin/bashfor i in 1,3,4,6 # #有几个数就循环几次 does echo $i donefor m in $ (cat/root/num.log) # #/root/num.log a few lines Just loop a few times do echo-e "$m \ n" # #echo-E to recognize "\ n" done Read-
Read command: Primarily used in the shell to read input, variables, text1. accept input from the standard input (keyboard) and assign the input data to the SET variable"Press Enter--indicates that the input is complete""If more data is entered than
The summation of 1...100Non-recursive: #!/bin/bash read num count=1 sum=0 val= "" ret= "" while [ $count -le $num ] do if [ $count -eq $num ];then val= $count else val=${count} ' + ' fi
Defining arraysIn the shell, the array is represented by parentheses, and the elements of the array are separated by a "space" symbol. The general form of the definition array is:Array_name= (value1 ... valuen)For example:Array_name= (value0 value1
Recently, when using shell to write scripts, I want to implement two very simple functions in Python: 1: Determine if a string contains another string. 2: How to implement the list of Python work: 1. Here to share with you.1: Determine if a string
The shell is much more programmatic in terms of programming than Windows batch processing, both in loops and operations.Bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.
Recently, in order to experiment with the installation of Windows Server Core server, the system without a graphical interface always gives a very complete feeling, we have the idea of security in the end, using the Windows Remote Shell management
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.