1 if statement
echo "Please input X"
Read X
echo "Please input Y"
Read Y
If [$x-gt $y]; In the [] condition, there must be a space before the [only space is followed]. Only a semicolon can be available, or there can be no semicolon
Then
echo "
Use Linux Programmer to enter password This behavior must be not unfamiliar, under Linux to the user has the strict permission limit, does many things crosses the permission to have to enter the password, for instance uses the super user to execute
First, Shell introduction
The design of many Unix-like operating systems is stunning. Even today, the UNIX-style operating system architecture remains one of the best designs ever. One of the most important features of this architecture is the
Scripts written in Bash can also be debugged, just like Python,perl and other interpreted languages. Create a new script named Servinfo and add executable permissions:
Copy Code code as follows:
$ VI Servinfo
#!/bin/bash
echo
Recently, the Linux batch execution of the script is very interested in looking around the Internet for expect batch execution script, today to share a batch password modification script.
Script content:
Copy Code code as follows:
#!/
First, install email send program
Copy Code code as follows:
Yum Install SendMail Mutt
Second, install the FTP client program
This script needs to use an FTP client program to upload files to the FTP space, so you must
Shell Script of Linux Basics
1 Shell sciptA program written in the instruction and basic program design structure to complete a complex process
1.1 Program Writing
Copy Code code as follows:
#!/bin/bash
# program:
# This
The script that recursively iterates through the directory with the shell writes recursively traverses the specified directory and prints the file name under the directory.
Example 1:
Copy Code code as follows:
#!/bin/sh
function
Today found a system to detect the integrity of the shell script, I tried it can be, introduced to everyone.System: CentOS 5.xScript content:
Copy Code code as follows:
Cat my_filecheck.sh
#!/bin/bash
#
# variable first declared to use
Basic knowledge of strings
Strings are the most commonly used data types in shell programming (except numbers and strings, and nothing else works), strings can be in single quotes, double quotes, or without quotes. The difference between single and
The hands of several VPS configuration iptables too cumbersome to see the Zhu Go lnmp script has an automatic configuration iptables firewall script, borrowed to change a bit, to the needs of the people;Only provide common port settings, if you have
1shell is an interface between the user and the kernel to interoperate,
2shell commands that can be run include Linux commands, built-in commands, utilities, user programs, shell scripts
3shell characters:
4. Get command help: Man,info.--help
5
Shell programming often involves the calculation of numerical values, and sometimes it is easy to forget or confuse the scenarios for these calculation commands, which is a summary of commonly used calculations. The main include let, BC, expr, (())
VIEditoris the standard for all UNIX and Linux systemsEditorThat it's powerful not inferior to any of the latest textEditor, here is simply a brief introduction to its usage and a small number of instructions. Because of any version of UNIX and
The test command has three types of test expressions, the first of which is the comparison of numeric values, the second is the comparison of strings, and the third is the testing of files, such as testing the existence of a file.1. Numeric test ,
Arithmetic operations are undoubtedly very important in shell scripting programming;The command to perform an integer arithmetic operation in bash is let, which has the syntax format:Let Arg ...Arg is a complete arithmetic expression consisting of a
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of
The problem arises because the current release is used by executing scripts, all of which are mvn packaged, while execution causes problems.The solution checks, locks 、、、 before the script executes#!/bin/bash{flock -n 3 if [ $? -eq 1 ]then echo
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