17th Shell Programming Basics (2)

Shell study1. Exit StatusIf the command executed successfully (or true), the value of $? is zero. If the commandfailed for some reason,$? Would containapositive integer between 1 and 255, inclusive. A failed command usually returns 1.2, testing an

Shell Scripting Tutorials

Http://www.runoob.com/linux/linux-shell.htmlShell Pass ParametersIn addition, there are several special characters for handling parameters: parameter Handling Description $# The number of arguments passed to

Shell Programming advanced 1.5 if logic judgment

Logical judgmentif. sh#!/bin/bash### #a=5if3 ]then "a>3" fiif. shA>3Vim if2.sh#!/bin/bash### #a=5if3 ]then "a>3"Fiif 4 ]then "a>4"fiif2. ShSH if2.sh>-ge greater than= =-eq equals! =-ne Not equal to>=-ge greater than or equal toVim

[Note]shell Basics of function usage

Functions: Naming rules are the same as variablesExecuting functions in the current shell processModularity of the program for easy maintenanceBasic function Syntax:        function  function name ()          {             Command Area          }    

Application of eval in shell

Application of eval in shellEval can be used for nesting of variablesDr=ddir$inumEval ssdir=$ (Echo \$ $SR)Example:#!/bin/bashDate= ' Date +%y%m%d

Shell Script Simulation Milter implementation of black and white list and keyword filtering

Program execution Flow:1. Start accepting mail.2. Check if the sender is in the blacklist, and if it refuses to accept it, continue3. Check whether the sender is in the whitelist, and if it is receiving mail, continue4. Keyword filtering of the

Shell redirection Debugging information

Shell redirection Debugging informationFulinux*************************************************************************************************************** ***********************Author: fulinuxReprint statement:

My first shell code--Hello World

Tried for a long time, and finally successfully output the Hello WorldExperimental environment$uname -a 4.2. 5-1-arch #1: x86_64 gnu/ Linux$GCC--versionGCC (GCC) 5.2.0Copyright (C) Free Software Foundation, Inc.This was free

Shell Common Small commands

1. Renaming1) Simpler processing command: MV original filename new file namesuch as: MV MyFile newName # # # will myFile renamed to NewName.2) Renaming files command: Rename name_old name_new fileFor example: Rename MyFile newName myfile.text # # # #

shell< two >

1. you want to download a software from the server, your machine has two network cards eth0 and eth1, the address is configured as follows:Eth0 : 192.168.6.25/24Eth1 : 172.16.101.25/24 default gateway: 192.168.6.1/24 server address:211.138.18.3

Shell's Gollum installation + comment

#!/bin/bash#by lcpanduan () {if [ $? -ne 0 ]then  echo  "=========== ====$1 not ok ==================== "  exit 1fi}function checkroot () {   if [  ' Id -u '  -ne 0 ]  then     echo   ' pleases do this  ' su -"'  &&     exit 1   fi}function tarruby (

Summary of Linux endpoints and Shell

Early computers because you understand the reason there are multiple physical terminals (by connecting the port of the computer what to achieve), here the terminal is the I/O device. The computer itself, which is inherently an I/O device (not an

Lao Li share: "Linux shell Script Raiders" Essentials (iii)

1, the production of any size file [[email protected] dd_test]#[[email protected] dd_test]# dd If=/dev/zero of=junk.data bs=1k count=1010+0 Records in10+0 Records out10240 bytes (Ten kB) copied, 0.00137023 S, 7.5 mb/s 2, File system related test [-f

Shell Getting Started-cut command

Command: CutOption:-d:-f Specifies the segment divided by ": (separator)" In the first paragraph-c Specifies the number of charactersDescription: Select the command, select a piece of data we want, generally for each row to analyze the

Shell Redirection File Descriptor

#!/bin/bashRecently looking at the shell, a variety of puzzles, but to solve the feeling of confusion is still very good. Needless to say, Linux uses file descriptors to identify each file object. The file descriptor is a non-negative integer that

Using shell scripts to build the source lamp environment

#!/bin/bash#auto Install LAMP#by Csy 2015-11-07#Httpd Define PATH

Shell Test Command

The test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file. Numerical test Parameters Description -eq Equals is True

Shell Script Summary 2

Echo ' seq-s ' 10 '--command to use anti-quoteecho $ (seq-s "" 10)(())LetExprBC--Features support for fractional counting$[]----------[Email protected] ~]# ((ruan=1*8-9))[Email protected] ~]# echo $ruan-1---------[Email protected] ~]# b=$

Linux Learning-Shell Basics-Bash basic features

   Historical command  History-C Clear-W Write ~/.bash_historySave 1000 By default, can be modified in /etc/profileCall      TAB completioncommands, directories, files Command aliasesAlias aliases = ' Original command 'Command execution

Shell Script Programming Overview (III): Functions and arrays

First, function: function1.function Conceptfunction is a Process-programmed , the purpose is to Code Reuse , is a Modular Programming , Structured Programming Programming Method function: The code of an independent function as a whole, and a name

Total Pages: 541 1 .... 357 358 359 360 361 .... 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.