Trap captures signals in the shell

Once the trap catches the signal, there are three ways to react:(1) Execute a procedure to process this signal(2) The default action to accept the signal(3) Ignoring this signalthe trap provides three basic forms for the above three ways:The first

Shell script-Judging Type

Test-judgedSee below:1 Echo " exist " Echo " Not exist "Determine if/opt/a.txt exists, output exist, otherwise output not existTest also has many uses: A "file type" judgment about a file name, such as TEST-E filename indicates whether or not it

string of Shell intercept variable

From: http://blog.sina.com.cn/s/blog_7c95e5850100zpch.htmlSuppose there is a variable var=http://www.linuxidc.com/test.htma # Intercept, delete the left character, and leave the right character. echo ${var#*//} where  var  is the variable name,# 

Shell Script Learning 18 shell for loop

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is:For variable in list do Command1 command2 ... CommandndoneA list is a sequence of values (numbers, strings, and so on), each

Linux Shell &, &&, | |

& placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times,

Sch Help Shell Scripting encryption 02

Sch Help Shell Scripting Encryption Geneva I. Span style= "Word-wrap:break-word; Font-weight:normal; font-size:7pt; Font-family: ' Times New Roman ' "> introduction SHC (shell script compiler) shell script compiler. by SHC Compiled

Getting Started with Linux shell

First shell script Program#!/bin/sh #第一行统一这样写echo ‘abc‘ #输出abc Run (because the directory is incorrect)[email protected]:~$ test.shtest.sh: command not found Programme I[email protected]:~$ sh test.shabc Scenario two (

Using date operations and comparisons in the shell

#!/bin/bashstartdate= "$" enddate= "$" date_fmt= "%y%m%d" source ./log.shexport debug= "true" function  showusage ()  { warn  "warn "------------------------ Usage ---------------- -------------  "warn "  Syntax:  checkInputDates.sh   "warn " "warn 

Shell string Removal

@1: Sub-string removal${string#substring}The shortest matching $substring is truncated from the beginning of the $string.${string# #substring}The longest matching $substring is truncated from the beginning of the $string.${string%substring}The

Shell Script Learning Case List

chmod u+x./shxx1. Simple Shell Programming SH example executionDisplay the directory and file in which you are located$cat Example#!/bin/sh#this is to show what a example looks likeecho "Our first example"Echo # thisecho "We Are"/bin/pwdEchoecho

Test NIC Traffic shell script

#!/bin/bashfunction Usage{echo "use./test_net.sh EthX Time"echo "Are You network interface"echo "The Last time!"echo "For example:./test_net.sh eth0 2"Exit}if [$#-lt 2-o $#-gt 2];thenusagefieth=$1time=$2old_inbw= ' cat/proc/net/dev | grep $eth | awk-

Linux--shell Script

Here is a summary of some of the recent learning Shell script knowledge pointsBlog Park-Bang Bang sauce Good * * *1. IntroductionThe shell is a text interface that lets us communicate with the system. The shell script is the one written for the

Shell Common Criteria for judging

1, determine if the folder existsif[-d/home/q/www];then Echo"true";ElseEcho"false"; Fi (folder exists in the system/home/q/www)2, determine whether the file existsif[-E/ETC/PASSWD];then Echo"true";ElseEcho"false"; Fiif[-F/ETC/PASSWD];then Echo"true";

Shell script: Write data to disk in bulk

First, about this article The monitoring system to be done requires monitoring the usage of disk space and alerting. When testing this feature, it is necessary to simulate two scenarios: one is the need to trigger the alarm mechanism when the disk

You may not know the shell

The shell is also called the command line interface, which is the interface between the user and the computer under the *nix operating system. The word shell refers to the program in the operating system that provides access to the kernel service.

Shell implementation Associative array

Shell implementation Associative array Shell implementation Associative arrayWrite the input and output of the array with the shell; there is a file, the first list of host names, the second column IP address, how to

Array of shell programming, basic manipulation of strings

ArrayConceptA pair of parentheses indicates an array, and the elements of the array are separated by a "space" symbol in the form: array= (value0 value1 value2 value3 ...), when the subscript of the array defaults to 0Basic operations1.arr= (1 2 3 4

Shell's awk associative array advanced application

Recently due to data migration, some user information needs to be re-confirmed, perhaps a large amount of data, but the need for the final confirmation of such as the user ID and its corresponding number of user points, which will lead to the

Shell programming-sort

Shell programming-sortThe sort sorting operation sorts a row in one or more files according to the set rules. Output to the standard output and will not be saved to any files.-T specifies the filed separator. The default value is space. Multiple

Restart tomcat shell and tomcat shell

Restart tomcat shell and tomcat shell #! /Bin/bash #1. Determine whether the service is available. 2. restart tomcat if the service is unavailable. #*/30 *****/home/wsm/restart. sh>/home/wsm/restart. log # Stop tomcatfunction killTomcat () {pid =

Total Pages: 541 1 .... 302 303 304 305 306 .... 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.