# scripts are only for Exchange learning and use!
# The current version of the script is 1.0. Implements the creation of physical volumes, removing, changing (enabling/disabling assignments), scanning, viewing features.
# The following will
If you are an IT person accustomed to a Windows command prompt, you will feel overwhelmed when you first use the Linux command line. You are familiar with DOS commands that are basically non-existent in Linux. In front of you is a lot of orders to
This section describes several shell scripts that can be used to extract I/O information from the disk, system load load information, and so on
1, extract the system load information
Copy Code code as follows:
#!/bin/sh
host=$ (hostname)
What are the shell specific commands in the Win7 system?
Shell:profile
The root directory of the currently logged-on user
Shell:usersfilesfolder
Same as Shell:profile
Shell:personal
The My Documents folder for the currently logged-on user
$ #代表了命令行的参数数量, you can look at the following examples:
Copy Code code as follows:
If [$#!= 1]; Then
echo "USAGE: $ tabname"
echo "e.g.: $ cdr_call_20040701"
Exit 1;
Fi
Position parameters $,..., $N, $ #代表了命令行的参数数量,
1. Operator (let marker)
+ Addition-Subtraction* Multiplication/Division* * Power operation3 Let "z=5**3"% modulobash$ Expr 5% 3
2. The comparison character (note [] and the variable need Space "")
Integral type comparison character-eq equals,
In a shell, you can pass arguments to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of $n, for example, the first argument is represented, and the second argument is $ $ ...
Examples of
This section mainly discusses the mathematical related shell script programming.
Addition operations
Create a new file "addition.sh", enter the following and give it executable permissions.
Copy Code code as follows:
#!/bin/bash
There are now port-proof tools, such as Psad, Portsentry, but feel the configuration is a bit cumbersome, and the server does not want to install an additional software. So I wrote a shell script to implement this function. The basic idea is: the
This example describes the Java method for invoking shell commands. Share to everyone for your reference. Specifically as follows:
Recently, the project has such a demand: the system of foreign currency funds after the completion of the dispatch of
The shell processing DB2 database, which is written for work needs, extracts DB2 data from the shell and processes it.
#SQL文定义
Sql= "SELECT AAA, BBB, CCC from MYTBL1"
#执行SQL
Sdata= ' DB2 ' "$SQL"
#返回值判断
If [$?-ne 0]
Then
#显示db2返回的错误信息
echo "
In Linux shell programming, date addition and subtraction operations are often used
I used to calculate myself through the expr function, which is troublesome.
In fact, the date command itself provides the addition and subtraction of dates.
Very
I/O redirect Detailed and application example
1, the basic concept (this is to understand the knowledge behind the premise, please be sure to understand)
A, I/O redirection is usually related to FD, Shell FD is usually 10, namely 0~9;
b, commonly
the parentheses are the orders. curly braces are variable valuesOne, parenthesis, parentheses ()1 , single parenthesis ()① Command Group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses
What is a shell script?Plain Text Document --the data stored in the document is stored in a character unit;a large number of command combinations to solve user problems according to user's needs;"Power of Execution"-the result of the multiple
RHEL5.4 OpenSSH upgrade to OPENSSH_7.4P1 version-shell processingCustomer 30 RHEL5.4 System OpenSSH needs to be upgraded to OPENSSH_7.4P1 version#cat/etc/redhat-releaseRed Hat Enterprise Linux Server Release 5.4 (Tikanga)# Uname-r2.6.18-164.el5pae#
The printf command is used to format the output and is an enhanced version of the echo command. It is a finite variant of the C-language printf () library function, and is somewhat different in syntax.Note: printf is defined by the POSIX standard,
Any partition used to 90% send a message to the specified recipient, to 95% on the subject of the message Warning (warning), instructions to send mail program email#!/bin/bash#Updated: 2008-03-03 PM by:leif ([email
Tag: Indicates the return value of the CTR online packet host Images network SRCDetermine which hosts are online in the current network (the ping return value is true, indicating that the host is online)The trap instruction is used to perform the
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