The shell monitors cpu,memory,load average, logs to log, and notifies the administrator when the load is under pressure.Implementation principle:1. Get the value of Cpu,memory,load average2. Determine if the value exceeds the custom range, for
Ehco and returnreturn Returned is the status code, function end Return does not return function return value You can return the function return value with echo in front, return the specified function exit status code Echo returns the
$*
Include all command-line arguments as a single text value
[Email protected]
Include all command-line arguments as separate text values
$#
Number of command-line arguments
$?
Exit
This article is part of the Linux Shell Series Tutorial (vii), more shell tutorials See: Linux Shell Series Tutorials
As with other languages, there are output operations in the shell, and in practical applications it is also very important to
Shell-7.shell Use of strings1. View the length of the string${#var} to calculate the length of the variable value:[Email protected] ~]# var= ' Yuanji '[Email protected] ~]# echo ${#var}62. Further discussion of single quotation marks, double
Q: What is a shell and what is a shell script?A:shell is a program written in C, which is a bridge between the user and the Linux operating system. The user can either enter command execution or use shell scripting to do more complicated operations.
CPU time is an important resource, and sometimes we need to track the process that consumes the most CPU cycles at some time.In a normal desktop or laptop system, the CPU is in a high-load state and may not cause any problems. But for servers that
The back quotation marks the top of the TAB key of the (') keyboard, and the 1 key to the left.Plays the role of command substitution in Linux. Command substitution refers to the ability of the shell to interpolate the standard output of a command
Typical examples:A=dateEcho $a establishedA =dateecho $a not set upActually, the reason is simple.The principle of the shell in interpreting the command is that the first symbol tag can only be a program or a command, when there is a space, the
One, single and double quotation marksFirst, both single and double quotes are meant to solve the problem of having spaces in the middle.The space is used as a typical delimiter in Linux, such as String1=this is a string, so execution will be an
Small black and began to toss new things, last week just learned OpenSSL construction private CA, Saturday took a bit of time to write this script, time Rush, finish to go to the DNS, if there are any bug please forgive me, this script is purely
Write a second shell script today and write the after-class questions in "private cuisine". The problem needs to write a check whether a name exists, does not exist to create a file, there is a need to determine whether the name of the file, the
Sshpass ToolsSshpass can install yum or download source package-P: Specify the password for SSH-O Stricthostkeychecking=no avoid a public key check for the first logon.#!/bin/bash/usr/bin/sshpass-p linux ssh-o stricthostkeychecking=no [email
What is here DocumentHere Document is a special redirection method in the Linux Shell, and its basic form is as followsCMD Its role is to pass the contents of the two delimiter (hereDocument content section) to cmd as input parameters.For example,
1 Shell Variable BasicsThe shell variable is a very "weak" variable, by default a variable holds a string, and the shell does not care what the string means. So for mathematical operations, you must use some commands such as let, declare, expr,
Conditional Logic on Files# Determine if the file exists and the file type-Afileexists. #文件存在-BfileExists and is a block specialfile. #文件存在, and it's a block device.-Cfileexists and is a character specialfile. # #文件存在, and is a character
Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day
Resources:Shell String Split recycle: http://www.shangxueba.com/jingyan/1633455.htmlDescription of the If else and greater than, less than, equal to logical expressions in the Linux shell: http://www.jb51.net/article/34332.htmShell array: Definition
Application method of dynamic domain name of peanut shell (detailed)1. First login Peanut Shell website http://www.oray.com/, select "Peanut Shell" in the navigation bar, then click "Peanut Shell Download", select the download version according to
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