This article mainly introduces the Linux Shell Script series (v): Mathematical operations, this article explains the use of Let, (()) and [] arithmetic, using expr for arithmetic operations, using BC for arithmetic operations three ways, the need
Description
SED is the abbreviation for stream editor (stream editor). It can perfectly match regular expressions. Sed and awk are the most important two commands for file editing. Especially involves a lot of regular expression of the problem, I
The shell is also called a command-line interface, which is the interface between the user and the computer under the *nix operating system. The term shell refers to programs in the operating system that provide access to kernel services.
This
Net-snmp is a free, open source SNMP implementation, formerly known as UCD-SNMP. Many SNMP are used after its installation, as a monitoring treasure and Aliyun system information monitoring. Let's share the Linux shell script that implements SNMP
1. Use the system $RANDOM variables
fdipzone@ubuntu:~$ Echo $RANDOM
17617
The range of the $RANDOM is [0, 32767]
If you need to generate more than 32767 random numbers, you can do so in the following ways.
Example: Generating random numbers
Use the Shell to judge
#!/bin/sh
mypath= "/var/log/httpd/"
myfile= "/var/log/httpd/access.log"
#-x parameter determines whether the $mypath exists and has executable permissions if [!-X "$myPath"]; Then mkdir "$myPath" FI # Here's the-D
#改改变量就可以了使用, the output information is automatically generated Mysql_backup.log logs to see when the script was backed up,CentOS 7 MySQL Automatic backup shell scriptSystem environment:CentOS7 64-bitMySQL-5.6Principles and tools:Shell
Using Nmap to scan the surviving hosts in batches
Knowledge Reserve: Grep,nmap
First, install Nmap1. Install the compilation environment[[email protected] nmap-7.01]# yum install gcc g++ gcc-c++ -y2. Download Nmap using
If condition judgment and if True and false judgment
Directory:1. Correct wording2. Wrong wording3. Summary
First, the correct wordingWhen writing shell scripts, to simplify the line numbers and structure of the code, it is common to
ObjectiveThe shell script was recently restarted due to job requirements. Although most of the commands are often used by themselves, they are always hard to read when written in scripts. And I always find it hard to read when I look at scripts
Now mostly use the Xshell, because Xshell has a personal free, or Chinese interface, for this level four is barely over, really good.Putty because it is too small, so often a lot of features can not be satisfied.SecureCRT in function with Xshell
Problem: Connect to the spark cluster remotely with SECURECRT, start Spark-shell but find the wrong command but can't delete it with backspace key.Workaround:The first step:Select the Options button in the SecureCRT menu bar and select "Session
When using HoloLens, the shell is made up of the world around you and holographic images from the system. We make this space a mixed world (mixed worlds). The shell contains a Start menu that allows you to place holographic images and applications
What is a shell? What does bash do? What's the matter?The shell is the interface between you (the user) and Linux (or, more accurately, you and the Linux kernel). Each command you enter at the prompt is interpreted by the shell before being passed
Original address: http://blog.sina.com.cn/s/blog_62eb16bb01014dbh.htmlOnce the trap captures the signal, there are three ways to react:(1) Execute a procedure to process this signal(2) The default action to accept the signal(3) Ignoring this
As already mentioned, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such variables are called special variables.For example, $ represents the ID of
#!/bin/bash#Created by Ley on 2014-11-14#Testing the Paramtersecho "The Compleate list is%s\n" "$$"echo "The Compleate list is%s\n" "$!"echo "The Compleate list is%s\n" "$?"echo "The Compleate list is%s\n" "$*"echo "The Compleate list is%s\n"
One, single and double quotation marksFirst, both single and double quotes are meant to solve the problem of having spaces in the middle.Because the space is in Linux as a very typical delimiter, such as String1=this is a string, so execution will
I. Functions in the shell[Email protected] aming]# cd/root/shell/aming[Email protected] aming]# vim fun1.sh//need to be aware that function names cannot conflict with some keywords in the shell#!/bin/bashfunction InP () {Echo $ $ $ $#}INP 1 a
Due to work needs, it took some time to study the two built-in special commands of eval and exec. Because not many are used, it is a bit obscure ..
1. Eval
This command is a built-in command in bashshell, which is a little more difficult than other
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