Recently in the Zabbix, the company has six new servers. When the Zabbix client is deployed, the baby is really angry. Grandpa's always so repetitive work is also not AH. But as a war five slag, what else can be mixed with rice? Think of last year
Using shell scripts to check service opening conditions#!/bin/bash# need to install Yum install Nmap first-y# checks whether the specified port is on function checkportstatus () {Status= ' Nmap-ss127.0.0.1-P $1| grep Open | Awk'{print $}'` if[
Bash supports many operators, including arithmetic operators, relational operators, Boolean operators, string operators, and file test operators. Native Bash does not support simple math operations, but can be implemented with other commands, such
#Dialog +shell IntroductionDialog+shell combined use, square can reflect the effect of Dialog graphics, in the operation of the time, the use of graphical interface, you can give you a more intuitive feeling, I believe you will like his 650)
#!/bin/bashfor i in 1,3,4,6 # #有几个数就循环几次 does echo $i donefor m in $ (cat/root/num.log) # #/root/num.log a few lines Just loop a few times do echo-e "$m \ n" # #echo-E to recognize "\ n" done Read-
Monitoring Programspeeking at the processesWhen a program runs on the system, it's referred to as a process. To examine these processes, your need to become familiar with the PS command, the Swiss Army knife of utilities. It can produce lots of
Progress bar in the future development, testing, operation and maintenance, can be automated inspection project updates, operation and so on, greatly accelerate the efficiency of work.1. Code implementation 1 #!/bin/bash 2 function proc () 3 { 4
Sort classification OperationsSample filesBoys in company c:hk:192:2192alien:hk:119:1982The hill:kl:63:2972aliens:hk:532:4892Star wars:hk:301:4102A Few Good men:kl:445:5851Toy story:hk:239:3972The command format for sort is: Sort-cmu-o output_file
Special variables
Variable
Meaning
$
File name of the current script
$#
The number of arguments passed to the script or function.
$*
All parameters passed to the script
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
Requirements: Read IP addresses and port numbers from a file, open the IP and ports with Iptablessuch as file content:[email protected] huwei]# cat ip.txt192.168.66.20 22192.168.66.30 10050192.168.66.30 33The manual action is:[[email protected]
Writing SQL in MyBatis, such as SELECT, involves a long list of names.'int (null auto_increment, ' name ' varchar (COLLATE) utf8mb4_bin, ' mainimg ' varchar (null,... Now you want to convert the column names in the table description to a
First, Judge read the string value
An expression
meaning
${var}
Variable var with the same value as $var
${var-default}
If Var is not declared, then use $default
As a result of the recent scripting, with exec, haha, today simply record a bit to deepen the impressionEXEC Execution ProgramAlthoughexecand theSourceis executed directly in the parent process, butexecthis andSourceThere's a big difference,Sourceis
Shell operators: Arithmetic, Relationship, Boolean, string, file testNative bash does not support simple math operations and can be implemented with awk expr, which is most commonly used in expr.Expr is an expression evaluation tool that uses it to
1. Introductiontake the home of Mechatronics website as an exampleafter the preliminary analysis, the electrical and mechanical Home data volume is large, and the data organization rules are more unified, suitable for code-based full-amount crawling.
#数组: Bash supports only one-dimensional arrays, starting with subscript 0.#定义数组: Array_name= (value0 value1 value2), as follows1 array_name=(2value03value14value2 5 )#还可以单独定义数组的各个分量, a continuous subscript may not be used, and the subscript range
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