Shell--if, Case Grammar detailed

1. Conditional Select if statementSelect Execute:Single BranchIf judgment condition: ThenBranch code with true conditionFiDual Branchif judgment condition; ThenBranch code with true conditionElseThe condition is a false branch codeFiMulti-Branchif

Classic Iptables shell Script

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

&& in Linux shell | | and ()

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

Shell Syntax One

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

Beginner Linux's Simple shell

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

Shell conditions and tests

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

Redhat Shell Scripting Exercises

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 script, a shell start-up process.

#一个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

Shell scripts, the configuration file load order, and when to load.

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

Conditional control in shell scripts and the use of loops

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

Variables of Shell programming

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 and kernel of the understanding reproduced

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,

function calls in the shell

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

Shell Learning--grep1

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

Shell Script Learning Summary 12--system signal

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

The SED syntax for Shell programming

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

Shell Programming while

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

Mu class Network Shell real-combat notes

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##################################

Shell Script---Array

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

Shell script Programming-arrays (array)

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:

Total Pages: 541 1 .... 366 367 368 369 370 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.