PS: This iptables script is good, very practical, according to the actual application changes can be used by themselves. Share it for everyone to reference. Original author Anonymous. The source code is as follows:#!/bin/shmodprobe
1. Introduction of the Linux command return valueWhen the shell executes a command, it has a return value that is stored in the shell variable $?. When $? is 0 o'clock, the command execution succeeds; when $ = 1 o'clock, the command execution fails.2
See the Shell function notation for reference/etc/init.d/functions printing information can be called, action functionLocal variable use plus local definitionGlobal variables don't add anythingNeed to execute the life using the anti-quote 'Strings
First occupy the pit, back to complement the perfect ha#!/bin/bash# program:# This program was used to stop Tomcat.# History:# 2016/09/11 XH First releasePid= ' Ps-ef|grep tomcat|grep-v Grep|awk ' {print $} 'if [$pid]ThenEcho ' Tomcat is already
Classification ReferenceFile Status Test
-B filename
Returns True when filename exists and is a block file (returns 0)
-C filename
Returns True when filename exists and is a character file
-D
Create a scriptCreate a script named/root/foo.sh on SYSTEM1 to provide the following features:1. When running/root/foo.sh Redhat, the output is Fedora2. When running/root/foo.sh fedora, output is Redhat3. When no parameters or parameters are not
#一个shell的启动流程 #shell have some variables, called environment variables, which can be inherited, #比如父shell有 $UID, child shells can have, and inherit the parent shell. #正常我们声明一个变量, a=1, in the child shell, A is empty, and the variable declared by
In the Linux system, there are/ETC/PROFILE,/ETC/BASHRC, ~/.BASH_PROFILE,~/BASHRC these four configuration files, these files, will be automatically loaded at some point, that is, a little bit, usually are some aliases, special variables inside. Four
Reprint please indicate: http://www.cnblogs.com/winifred-tang94/If conditional statement syntax:If [conditional expression]ThenCodeElseCodeFiNote : In the IF condition statement above, there should be a space between if and [, and the conditional
Variable:A variable is made up of letters, numbers, and _, and cannot begin with a numberLength cannot exceed 255 charactersIn bash, the default type of a variable is a string typeVariable classification:1, user-defined variables: only in the
The Shell's English interpretation is the shell, echoing with the kernel kernel noun, one outside, one shell and one core. The kernel is like the Bank of Switzerland's treasury, storing the customer's gold and many other (hardware) assets,
What to learn in this chapter---------- Function Introduction---------- function Definition---------- function uses---------- differentiate return and the Exit---------- Delete a function---------- Precautions1. Introduction function When you
I. SOURCES of grepTo find a string by using the EX Editor::/pattern/pwhere P is printed, the first line containing the string pattern is printed, if you need to print all lines that contain pattern, you can::/g/pattern/pWhen G appears in front of
Signal is a process communication mechanism in Linux system. We can use a specific signal to interrupt the process. Each signal is associated with an integer value.The KILL command can be used to send a signal to a process, while the trap command
First in the slot ads: want to go into a folder to see the following files must have permission to execute this file folder.SedP prints the corresponding line 2p prints the second line.-N outputs only rows processed by the SED commandLook at the
Script Programming:Sequential structureSelect structureIfCaseLoop structureForWhileUntilWhile loop: For scenarios where the number of cycles is unknown, exit conditions are neededGrammar:While CONDITION; DoStatement...Done Calculates the and of all
Shell Footstep Source code:[Email protected]_ecs imooc_shell]$ lscheck_http_log.sh check_nginxserver.sh master_control.sh system_info.shMaster_control.sh: The main control footsteps, other footsteps this script calls##################################
Array definition: The so-called array, is the same data type of elements in a certain order of the set, that is, the finite type of the same variable with a name command, that is, these variables are defined as a group, they do not have their own
The difference between an array and a variableVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray = array name + indexIndex:
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.