OutFile is forbidden, or written files are intercepted;Operations in the database are as follows: (must be root permission)Show variables like '%general% '; # View Configuration Global general_log = on; # turn on general log mode Global
In order to automate the receipt of file backup information from the server, the MUTT+MSMTP is used to send e-mail in the shell environment, which is an easy and efficient way to complete operations.Download MSMTPwget
1 exec BuiltinDo not create a child shell, start a new script on the original process, but it will clean up the environment of the old shell, so it does not inherit from the original shell, execute the new script in a clean environment. Exit the
1. Logical operators;Logical operator Instances:A=Tenb= -if[$a! =$b]then Echo"$a! = $b: A! = b"ElseEcho"$a! = $b: a = b"fiif[$a-lt --A $b-GT the]then Echo"$a less than 100 and $b greater than 15: Returns True"ElseEcho"$a less than 100 and $b greater
This article: Determine whether the user input parameter is a numberHow is the calculation done in the shell?
Way One
[[email protected] scripts]# echo $((1+2)) 3
Way Two
Note: When using the method two, the requirements
Because of the need for plaintext to display passwords in the script, the idea is to encapsulate the already edited shell script into a binary executable file.Using the tool SHCOfficial Download site: http://www.datsi.fi.upm.es/~frosal/Use the
1. Arithmetic operator: Native bash does not support simple math operations, but can be implemented with other commands, such as awk and expr,expr most commonly usedExpr is an expression evaluation tool that uses it to perform the evaluation of an
#!/bin/bash: Program:NFS Server installbr/>[email protected]20171129 v1.020171130 v1.1 Modify the following:1. Cancel the grep "style" file &>/dev/null if [$?-ne 0];then Usage, modify to if grep-q "style" file; then method2, all changed to function,
I. Condition selection, judgment (if, case)1.1 If statement usage and examplesWhen we encounter the need to judge in the script, we can use the IF statement to implement. The specific syntax is as follows:Single Branchif judgment condition;
Linux Shell location Variables in detail what are positional variables?
Simply put, when the user runs the script, input parameters, the variables corresponding to these parameters are called positional variables.
Overview of the use of parentheses in the Linux shell 本文主要介绍Linux中括号的用法,主要包含判断文件和变量。**注意事项**:中括号两边必须有空格。The knowledge involved in using brackets &&, | | | 在本文对文件或者变量做判断的时候,可能会多次使用到&&和||这两个符号,所以在我们进入中括号的学习之前首先了解一下这两个符号的作用。 &&:
Shell programming is actually a program that combines multiple commands, based on bash.Serious attentionThe difference between $hostname and $ (hostname)$hostname is to take the value of the hostname variable$ (hostname) is the execution result of
Exercise 1:Formatted outputRequirements: Enter a string of random numbers and then output by thousand. for example, the input number string is "123456789", the output is 123,456,789#/bin/bash# date:2018 March 15 read-p "Please input a long number:"
Users of the Linux server should know that when Linux is in use, the available memory will slowly become smaller over time, and it may eventually reach 80%-90%, which requires us to intervene manually to release the Soul village.This article will
$ Current PIN name$# the number of arguments passed to the scriptThe first parameter, and so on$*,[email protected] All parameters$$ Current Shell Process IDShell output shell name, PID, number of parametersList parameters in sequence#!/bin/bashecho"
one, special characters 1.Any character of ' * '‘? ' Any one character' # ' comment characters' \ ' de-semantic characters' | ' Pipe characterMost of them have been used before, for the caret ' \ 'Examples of the use of the caret2. Several
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.