Shell programming------Judgment Statement

1. If Judgment statement:Integer judgment:-eq equals-lt less than-gt greater than-le less than equals-ge greater than or equal to-ne not equal tostring judgment:-Z is null-n NOT NULL = equals! = is not equal to \> greater than \Logical judgment:-A

Day9-1 Shell Basics

The shell is a command interpreter that provides user and machine interaction before Command historyPress UP ARROW key to appear before order historyHistory View Previous commandsThe command history exists in the file. Bash_historyThe maximum

Shell Scripting Encryption

A goal is a dream with a deadline. Much effort, Much prosperity.Why Encrypt shell scripts? Of course it's for security!Maybe the script involves a password or something, and it needs to be encrypted.I. Download and install the SHC toolTo protect

Shell basic Syntax (i)

Composition + Execution Need to add #! at the beginning /bin/bash Lines that begin with # are interpreted as explanatory notes The name of the script ends with. SH and is used to differentiate between this is a shell script

Scripting of Shell Learning 1

Script Requirements:After executing the scriptAccepts input 1, displays the current time, and prompts you to continue the selection.Accepts input 2, displays the CPU load, and prompts you to continue the selection.Accepts input 3, displays the

Shell Script--grep command for content lookup

The grep command retrieves the rows in the file that contain keywords (which can be used), and is case-sensitive by default.  Use the-c parameter to get the number of rows that contain the keywordUse the-n parameter to display the line number at the

Shell Exercises 20180119

Design a script that monitors the surviving state of a remote machine (assuming IP 123.23.11.21) and sends a message to yourself when it finds an outage.Tips:1. You can use the ping command: PING-C10 123.23.11.212. E-mail script can refer to: https:/

Linux Shell Basics (vi) AWK commands (in edit)

First, the awk command awk是一种**编程语言**,用于在linux/unix下对文本和数据进行处理(gawk - pattern scanning and processing language)。centos7中的awk是gawk的链接。它支持用户自定义函数和动态正则表达式等先进功能,是linux/unix下的一个强大编程工具。前面的grep、sed只是单纯的工具,而awk已经是一门语言了,可见awk的功能将比较强大 用法:

Shell Exercises 20180117

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

Shell Script--shift parameter left

What does it mean to move the parameter left? This parameter refers to the arguments that follow the script name when you run the script, you can use the $ #来获取参数的个数, use $* to get all the arguments, and the left side of the argument is this: there

Shell Script--functions

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 character and job control 8.7/8.8 shell variable 8.9 environment variable configuration file

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

Shell Script First Lesson

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:

Linux shell--is expression

RegularGrepMatch, and can display the colorfilter, display line numbers, case sensitiveGREP-V ReverseTake 2 lines, next 2 lines, two rows above and belowLines that begin with #Do not print the beginning of the #, for example, when looking at the

Shell programming The Four musketeers sed

(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

Shell Four Swordsman awk

(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)

Shell Beginner (iii) pass the argument

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

Linux Shell Basics

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

Shell sort (Hill Sort)

  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

Shell beginner (ii) variables and arrays

Lite version:Definition: your_name=123 ps:= symbol can not have space around! Use: ${your_name}, you can use the variable alone without {}Read only: readonly your_name PS: not deleted after set to read-onlyDelete: unset your_nameQuotation marks:

Total Pages: 541 1 .... 515 516 517 518 519 .... 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.