Shell scripts-making your own service scripts

Let's start with an example: Suppose you have a test service that can start, shut down, or restart test by command, the following script simulates this feature:#!/bin/bash#test.shcase $ in start) echo "Starting service ..." sleep 1

8.10 Shell Special Symbol cut command 8.11 sort_wc_uniq command 8.12 tee_t

8.10 Shell Special Symbol Cut commandCommand: CutUsed to intercept a fieldSyntax: cut-d ' delimited character ' [-CF] n Here's n is the number-D: followed by delimited characters, separated by single quotation marks-C: followed by the first few

Shell script third--monitoring the host disk space, when the use of space more than 90% by sending mail to send a warning

Shell Script third-- Monitor the host's disk space and send mail to warn when more than 90% space is used#!/bin/bash#monitor available disk space#提取本服务器的IP地址信息ip= ' ifconfig eth0 | grep "inet addr" | cut-f 2-d ":" | Cut-f 1-d "" 'space= ' df-hp |

8.1 Shell Introduction 8.2 command History 8.3 command completion and alias 8.4 wildcard 8.5 input/output weight

8.1 Shell IntroductionThe shell is the intermediate medium used when the system interacts with the computer hardware, and it is just a tool of the system.The user directly faces not the computer hardware but the shell, the user instructs the shell,

Sylixos execution of In-module functions under shell command line

1. Scope of applicationThis document describes the implementation of the function implementation principle in the kernel module in the shell command line.In VxWorks, the system comes with the function of directly executing the driver and in-app

Pipe and job control, shell variables, environment variable profiles

Pipe characterIt is used for the output of the previous instruction as input to the latter instruction.650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/16/1a4adbd82674ccd735f9b4748eaac9ac.png-wh_500x0-wm_3 -wmp_4-s_2715965200.png "title="

Shell scripts replace file names and contents of files in bulk

Method 1:These two days in the camera Bringup, need to add chromatic file, because there is too much to replace the contents of the file, manually change the file configuration a bit less practical, so Google a bit, to find a good way to replace the

Linux shell script statements, functions, detection services, startup script exercises

I. If statement650) this.width=650; "src=" Https://s4.51cto.com/oss/201711/11/8a70ba0e53f279453f8d8b3561cedf7f.png "style=" float: none; "Title=" screenshot from 2017-11-11 20-01-52.png "alt=" 8a70ba0e53f279453f8d8b3561cedf7f.png "/>650) this.width=6

Running the shell command from the terminal in the background under Linux

Have you ever experienced a situation where you log in to a remote Linux host from the terminal software, Compress a large pile of files into a. tar.gz file, compressed for half an hour is not finished, at this time, suddenly you broke the network,

Shell grooming (31) = = = A small example of common year leap year and nested loops

Topic (i)There are 1 2 3 44 digits, any combination of how many different and no duplicates of the number, what is the difference?The shell code is as follows:#!/bin/bashFor i in ' seq 4 'DoFor x in ' SEQ 4 'DoFor y in ' seq 4 'Do[$x-eq $i] &&

Using the shell to write a script that detects system parameters

Script to detect OSObjective: After learning the shell language, according to the script that has been learned to write a shell to detect some of the system parameters to achieve email alerts,(I have just learned to write less perfect and practical!)

Odoo 10 deployment Shell to be improved

Environment Ubuntu16+nginx+python2.7.12+postgresql9.5+odoo 10.0 Community#!/bin/bash#author:[email protected] #date: 2017-09-06#description: Deploying Odoo 10.0 Shell Ubuntu >=14odoo_options

How to use various parentheses in the shell [shell programming]

Reprinted from: http://www.jb51.net/article/60326.htmWhat I want to say here is a few shell parentheses, braces and parentheses, the use of commands, as follows:1.${var}2.$ (CMD)3. () and

Linux Shell Programming Four Musketeers-awk

Awk" Syntax "awk "option" pattern action filenameprogram:pattern+actionIf there are multiple statements in the action, you need to use;Eg:awk ' begin{test= "Hello gawk";p rint test} '1. PrintPrint item1,item2, ...1) Comma delimiter2) Each item of

Shell script $# $ $@ $* $$ $! The meaning of the $?

Reprinted from: http://www.cnblogs.com/davygeek/p/5670212.htmlLearn to write a script today encountered some variables do not know, here do the next record. Variable Meaning $ File name of the current script

Shell script usage of some basic statements

A. For statement1. Use the For statement to add users in bulk650) this.width=650; "src=" http://s3.sinaimg.cn/bmiddle/006OWCmEzy7cGLCj6ued2&690 "Name=" Image_operate_ 75451500196244212 "alt=" shell script some basic statements of the use of "title="

Shell Introduction: What are the two ways to execute a shell,shell command

The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and

Learn shell programming in the case

1. Write Script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address,OS version, kernel version, CPU model, memory size, hard disk size.Analysis:Explain:This is a stack of commands, and it's easy to

How to calculate the numbers in the Shell (bc/expr/$ (())/let/awk)

1.bcCommon calculation Tools , and supports floating-point arithmetic:[Email protected] shell]# echo | Bc2floating point number accuracy problem not resolved[Email protected] shell]# echo "1.2*1.2" | Bc1.4[Email protected] shell]# echo "scale=2;1.2

Java connection remote Linux Server execute Shell script view CPU, memory, hard disk information

Pom.xml Jar Package Support com.jcraft jsch 0.1.53 Code:Package Com.spring.bean.annotation;import Java.io.bufferedreader;import Java.io.ioexception;import Java.io.inputstream;import

Total Pages: 541 1 .... 94 95 96 97 98 .... 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.