A shell script is a special application that acts as a "command interpreter" between the operating system kernel and the user, takes care of the user input commands and interprets them, passes the required actions to the kernel execution, and
Shell variable one) Global environment variablesA global variable is visible to both the shell that defines it and its child shell, but if the shell that generates it is terminated, the global variable disappears. In addition, the global variables
There is a server as a Web application, there is a directory (/data/web/attachment) is not timed to be uploaded by users of new files, but do not know when to upload. So, we need to do it every 5 minutes to detect if a new file is generated. Please
Some bits and pieces of basics I. Understanding shell scriptsa) Related conceptsThe shell is a command interpreter that executes the commands and programs that the user enters in order (the command that encounters the sub-script, which executes the
I. Special symbols in the shellNumber: wildcard character, can match 0 or any number of characters? Number: Tan,#号: An annotation character that is followed by a command or parameter that does not execute\ No.: Raise the meaning of the instruction
Pipe symbolTake the previous result as input to the following commandJob ControlCtrl +z pause the current task into the backgroundRestart incomingJobs view the commands in the backgroundBG is in the background and runningSleep 1000 PauseFG does not
The shell's functions are the same as Javacript and PHP's function declarations, except that when the shell calls the function, it can call the function simply by writing the function name, noting that parentheses are not appended to the function
8.6 Pipe symbol and job controlPipe symbol | is to give the result of the previous order to the following command.Using this file for experimentation, Vmstat 1 is a constant display of some state of the system.Re-testing Jobs BG FG is a featureMove
Please look at the rules of several numbers below and use the shell script to output the following 10 digits10 31 53 77 105 141 ... [[email protected] ~]# cat 1 .sh# !/bin/basha =20 b =2 c = 10 echo $c for i in ' seq 0 20 "
The file name of the shell script usually ends in. sh, or in other formats, such as. txt or even without a suffix. The #!/bin/bash of the first line of the script represents the parser that specifies when the script executes.#!/bin/bash# file name:
Shell IntroductionShell is a Linux interactive media with users the CentOS default shell is bashCommand History 2User home directory file record command historyLs/root/.bash_historyHistory view commands Historical maximum can view 1000
(1) SED effectSED is a non-interactive text editor, and the Contrast VI (VIM) is an interactive editor(2) SED syntaxsed [-option] [command] FilesComments:SED tool default processing text, text content output screen has been modified, but the
What is a shell?The shell is the user interface of the system, which provides an interface (command parser) that the user interacts with the kernel, and the shell receives the user's input command and sends it to the kernel for execution, such
(1) awk principleThe principle of awk is to process the data in a file line by row, find content that matches what is given on the command line, and then program the next step if a match is found. If no match is found, continue with the next line.(2)
OneScript code: test.sh"Shell passed argument instance!" "; "file name executed: $"; "The first parameter is: $ $"; "The second parameter is: $"; "The third parameter is: $ $";Execute the file name:./test. SH The first parameter is:1 the
1.shell (Bourne Agin Shell) is a command parser that provides interaction between the user and the machine, as well as zsh, Ksh2. Where are the orders that we have knocked on? In the. bash_history file in your home directory, you can save up to 1000
This sort algorithm is very powerful, I personally like this algorithm, but the time complexity of the algorithm is difficult to calculate. The algorithm's choice of increments (here also called step) also needs to be noted, remembering only 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