CentOS6.8 x86_64bit shell scripting to simulate Nginx service startup and shutdown

Shell script simulates Nginx service startup and shutdownNote: 3 slashes////is followed by a representation of the interpretation of the current statement, which must be removed in the actual script#!/bin/bash///defines which scripting language

Shell Loop statement

One, for-done (not very common)1. GrammarFor variable in name table do ... done2. Script Sample Code#!/bin/shfor num in 1 2 3 4 5do echo "number is $num" done3. Execute script[Email protected]]# sh hello.sh4. Implementation resultsThe number

Shell Process Control Statements

First, ifSyntax format: If test-d $arg then ... else ... fiVariable test statements can be simplified with []. Example: test-d $arg equivalent to [-D $arg]. (Note: "Space" ["Space"-D "space"])For more test commands see: http://www.cnblogs.com/fangwu/

Conditional judgment and comparison of shell scripts

common syntax for conditional testing: Syntax format Description [] [] has at least one space between the boundary and the content [[ ]] [[] There is at least one space between the

Shell Script Basics

Shell Script Basics脚本: 一个可以执行的文件,实现某种功能 – 需要提前设计、智能化难度大 – 批量执行、效率高 – 方便在后台静悄悄地运行Standardize the general composition of shell scripts? #! Environmental Declaration (what procedure to translate the following command)? # comment Text? Executable code

Using the shell to develop the Rsync service startup script

Using shell functions to develop the Rsync service startup script, previously unprofessional#!/bin/bash#chkconfig: 2345  20 80                         #这两行加入kconfig #description:  saves and restores system entropy  poolsource /etc/init.d/functions   

Shell built-in commands and operating methods

1.!#/bin/bashThis is the first line of the shell script, and/bin/bash represents the location of the script's interpreter.2. Run the script:    (1) Bash test.sh(2) Bash-x test.sh (ps:-x for observing script running state)(3) Release script

Shell Scripting Exercises

Shell script exercises 1. Script/root/bin/systeminfo.sh, which displays the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size. #!/bin/bash

Shell Programming Basics

1. Execution style of the programProgram Programming Style:Past: Command-centric, data-serving instruction.Object type: Data-centric, instruction serves data.Program programming has the following characteristics:1) Sequential execution: refers to

Shell Scripting App (shell scripting Basics vs. Shell variables)

1. Shell: Command interpreter1) supported shells are saved in/etc/shells2) Default shell is/bin/bash2. Shell script writing:1) using the VI Editor2) One command per line, followed by3) Give executable permissions (x)3, the way of implementation:1)

Eighth Linux Shell Basics

8.1 Shell IntroductionThe Linux shell is simply a process of a command line and user interaction. You make an order and it will result. Similar to the CMD window inside windows.8.2 Shell Command HistoryAll the commands that have been knocked out

Shell exercises to count memory usage

Demand:Write a script that calculates the amount of memory that is consumed by all processes in the Linux system. (hint, use PS or TOP command)#!/bin/bashtime= ' date +%y-%m-%d-%h:%m:%s ' # #方法一s =0for m in  ' ps aux |awk  ' { print $6} '  |grep -v 

Shell gets string length

Method 1: Use the wc-l commandWc-l can get the length of the current row, so the string for a single row can be obtained in this simple way, and the wc-l is the number of rows that get the current string content.The code is as follows: Echo "ABC"

The shell automatically log out of inactive users after a period of time in CentOS

By defaultShellis not timed out automatically, but it is sometimes necessary for it to automatically exit the terminal after a period of inactivity without an operation. 1. Create a file /etc/profile.d/autologout.sh :#

Shell Script Note (iii) mathematical calculations in the shell

Mathematical calculations in the shellOne, use square brackets#!/bin/Basha=tenb=c=res=$[$a * ($c-$b)] Echo $resIi. usage of BCBC Technology is actually a programming language that recognizes: numbers (integers and floating-point numbers)

Shell special Characters

Special symbols Wildcard characters, any character? Any of the characters. #注释字符\ de-Semantic characters| Pipeline Several commands related to pipelinesCut select information for the row analysisMain parameters-B: Split in bytes. These

Shell Introduction Command history command completion and alias wildcard input and output redirection

8.1 Shell IntroductionThe shell is a command interpreter that provides interaction between the user and the machine to support specific syntax, such as logical judgment, looping each user can have their own specific shell CentOS7 default shell for

Shell Display with color font

Format: echo "/033[word background color; font color m string/033[control code"If you simply display the font color can be fixed control code bit 0m.Format: echo "/033[word background color; font Color m string/033[0m"Word background color range: 40-

8.1 Shell Introduction 8.2 command History 8.3 command completion and alias 8.4 wildcard 8.5 input/output weight

Five week third class8.1 Shell Introduction8.2 Command History8.3 Command Completion and aliases8.4 Wildcard Characters8.5 Input and output redirection8.1 Shell IntroductionShell Introduction8.2 Command HistoryCommand-historyHistory environment

Shell monitoring scripts----hard disk space and memory

Real-time monitoring of the local memory and the remaining space on the hard disk, the remaining memory is less than 500M, the root partition remaining space is less than 1000M send alarm message to the root administrator1 Writing scripts[Email

Total Pages: 541 1 .... 246 247 248 249 250 .... 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.