Shell---grep command detailed

First, grep ----"Line filter Tool" grep (Global search Regular expression (RE) and print out of the line, fully search regular expressions and Printing a line is a powerful text-search tool that can use regular expressions to search for text,

Talk about export and Source,bash in shell scripts.

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

Shell Scripting Exercises

First, using the shell script to implement the progress bar#!/bin/bashfunction proc ()   4 {  5     count=0   6     bar= ""   7     lable= ("|"   "/"   "-"   "\")   8     while [  $count  -le  100 ]  9     do 10              let index=count%4 11     

Shell scripts: Exercises

Topic 1:1-100 summationNon-recursive version:#!/bin/bashsum=0while [$val-le]dolet sum+=vallet val++doneecho $sumsum =0for i in {1..100}doif [$i = = 1]; Thenbar=${bar}${i}elsebar=${bar}+${i}filet Sum+=idoneecho $bar = $sumsum =0for ((i=1; iOperation

Use Shell to modify IP aliases for ansbile host files

#需求Original content 10.221.29.30 modified: qq1-5f ansible_ssh_host=10.221.29.30Original content 10.225.32.75 modified: qq6-10f ansible_ssh_host=10.225.32.75Original content 10.221.249.127 modified: qq11-15f ansible_ssh_host=10.221.249.127#文件展示[Email

Shell---related simple program normalization

1, 1-100 number summation① non-recursive methodShell650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/0B/wKiom1dpIcHBcRrUAABevxRp8l8674.jpg "title=" Sum1.jpg "style=" Float:none; "alt=" wkiom1dpichbcrruaabevxrp8l8674.jpg "/>Operation

[Shell Foundation]--echo Command

echo command: Used primarily for output in the shell 1.-N does not wrap the display result (by default, the line is wrapped) 2.-E "" supports using some special characters in double quotesThe usual special characters are\a a warning sound; \b

[Shell Foundation]--read Command

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

Start the ultimate Efficiency Shell Tour (1)

An efficient development environment is undoubtedly of great help to our daily work, and time is saved by these tiny details.Next, I'll show you how to configure ZSH+INCR to create the ultimate and efficient development environment.First, let's look

[Shell base]--variable

Assigning values to variables#定义变量, note that there is no space on either side of the equal sign variable=#定义环境变量Export variable=#双引号: Can contain spaces, can escape special characters variable="" #$ () or anti-quote: assigns a command

The shell command loops through the directory to match the keywords

#!/bin/bashwhile read Linedo for file in/home/local/test/* does if test-f $file then sed-n "/${line }/p "$file >>/home/local/out.txt fi Donedone Task: To file from the Home/local/test folder belowFile_1.logFile_2

Shell script Programming

650) this.width=650; "title="%]bw ' BI7 ') 2O) 8$ @MNDGKKM. png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/ 83/11/wkiol1dqljdcexdmaaaonuc13sa029.png-wh_500x0-wm_3-wmp_4-s_2178205859.png "alt=" Wkiol1dqljdcexdmaaaonuc13sa029.png-wh_50

2nd Chapter into the shell

several termsMute terminal (dumb terminal):A dumb terminal was usually nothing more thanA monitor and keyboard connected to the Unix system via a communication cable (usually a multiwireSerial cable multi-line serial cable, also called ribbon cable).

"Shell" conditional judgment

expression format for conditional judgments:File Judging type:[[Email protected] ~]# [-E/ROOT/1] && echo yes | | echo no #注意 [] inside the space, the first command is true print Yes, otherwise print noyes[[email protected] ~]# [-F/ROOT/1] && echo

Shell script Programming Exercises

Create loops in shell scripts to append echo content redirection to a file650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/82/E7/wKioL1dj6XHwzJ-tAAAoItNjmwc457.png-wh_500x0-wm_3 -wmp_4-s_2295541797.png "title=" qq picture

Shell Script Application Applet

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   

3 ways to redirect Shell files

Three ways:1.While Read lineDoDone2.For line in ' cat filename 'DoDone3.Cat FileName | While Read lineDoDoneCases:Reads data from the Math_file file, outputs the maximum, minimum, and average values1.650) this.width=650; "src="

String interception of shell scripts under Linux

1 #!/bin/bash23 str= "Http://www.baidu.com/test.htm"45 #echo ${str}The result of the operation is:http://www.baidu.com/test.htmMethod One: #截取, delete the left character, leave the right characterEcho ${str#*//}#*//means to delete the first//number

Shell Note 2 Tput

Shell ArrayCommand_list= ([add]= ' Add '[del]= ' Delete '[edit]= ' Modify '[query]= ' query ')Get index: ${!command_list[*]}, according to the index submission value, perform the corresponding operation.Get length: ${#command_list [*]}, traversing

Shell Initial involvement

I. Concept:The shell, commonly known as the shell (used to distinguish it from the kernel), is a command-line interpreter that receives user commands and then invokes the appropriate application. Two. Type of shell:1. SH (Bourne Shell):

Total Pages: 541 1 .... 467 468 469 470 471 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.