Shell script to create nginx upstream and location configuration file

#!/bin/SH###################################################### name:create_nginx_conf.SH# VERSION:V1.0# Author: OPS Rookie # Description: Creating Nginx-related Profiles # Create Date: .- --Geneva# Email: ############################################

Linux shell script Programming--string interception

String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.Echo ${var#*//}where Var is the variable name and the # is

Shell script variables

Shell script variable What is a variableReplace another complex or volatile data with a simple "word"Display and setting of variables: The display of Echo,unset variables Echo ${path}Setting rules for variablesequal sign Connection variable =

Shell Script (ii)

A test condition to judgeReturns a 0 exit state if the expression is true, or a non-0 exit state if the expression is false. Test has an alternative syntax, which is easier to read by enclosing the expression with parentheses "[]".1. string

Linux Shell Basics

some things to note about shell script:1, #这个符号是注释本行, usually used for annotations, #! Except that it is used to label which Shell executes this script,2, the order of execution from top to bottom, from the right3, ignoring blank lines, tab spaces4,

Shell script Use tips 3--function call

Defining functionsfunction fname (){statements;}OrFName (){statements;}Pass parameters to the function:fname arg1 arg2;Exfunction parameter definition:FName (){echo $, $;echo "[email protected]";echo "$*";return 0;}Detect whether the command

Shell Cut Command

Meaning: Split the file by column according to the delimiterSyntax format: cut [options] ... [File] ...-C, --characters by character-F,--fields by column-D,--delimiter specifies delimiter, default is tab (\ t)Example: viewing file contents Cat

<< reprint >>shell Some mighty commands

---------Transferred from http://www.runoob.com/linux/linux-shell-array.html----------Copyright belongs to the original! Shell some powerful commandsShare some shell usages and scripts that you may not know about, simple & powerful!Before reading

On-my-zsh pretty shell.

OneHttp://www.cnblogs.com/GarveyCalvin/p/4301235.htmlTwoForeword: Zsh can be configured strong, user can customize the configuration, personalization is strong. Zsh Tab Completion is more powerful, this feature allows us to save a lot of time. Zsh

Use of the grep command for Shell programming

Before you learn the regular expression, be clear and keep it in mind:In Linux, wildcards are interpreted by the shell, while regular expressions are interpreted by commands, so don't confuse them. Remember!!!usually have three text Processing tools/

Shell Test command, Loop statement

Test command, Loop statementTest command format:Test conditionUsually, in the If-then-else statement, [] instead, that is, [condition]. Note that there are spaces on both sides of the square brackets.Common commands:-a two conditions at the same

Get time in the shell as a folder format

Recently wrote a small program, need to use time. Traverse as part of a folder#!/bin/bashfor i in {1..30}dodate= ' date +%y/%m/%d-d "$i days Ago" ' Echo $datedoneFor loop, take the date of the recent n days.The core isDate= ' Date +%y/%m/%d-d ' $i

Basic usage of the shell

One: Shell introduction1. What is a shellThe Shell's Chinese meaning is "shell," in layman's words, the shell is an interactive programming interface that uses the user input to drive the operating system kernel to complete the specified work. In

Shell Programming (ii)

Bo main name: Li ChangmingPost Address: http://keep88.blog.51cto.comThis note is from the old boy books: Learn Linux OPS Shell programming with old boysThe advanced and practice of shell variable knowledge1. Special positional parameter variables in

[Shell]system and EXECLP simple examples

shell script : hello.sh#!/bin/bashecho"I am in shell script"echo"param 1 is'echo'param 2is $"variable=$[$1 + $2 ]echo"sum is $variable"System Interface : SYSTEM.C#include void main (void) { printf ("I am in C code!\r\n" System ("/bin/bash"). /

Shell with color output

Here is a record of how the shell script can be color-output, using a bit in Python also applies.echo Display in shell script with color display, echo display with color, need to use parameter-EThe format is as follows:Echo-e "\033[word background

Shell Cut Log Script

Vi/etc/logrotate.d/nginx #编辑脚本/usr/local/nginx/logs/*.log/usr/local/nginx/logs/nginx_logs/*.log{Missingok # ignores errors, such as "log file cannot be found" error message. Dateext # The log file after the switch is appended with the date of the

Wrote a simple Linux shell to download files

#!/bin/SH for((i=0; i -; i=i+1)); Do# Use the spider to detect if the requested resource exists and write the result of the request to a

Shell, CMD, DOS, and scripting language differences and linkages

Issue One: dos differs from windows in cmd On Windows systems, start-run-cmd can open "cmd.exe" for command-line operations. The operating system can be divided into the core (kernel) and shell (shell) two parts, wherein the shell is the operating

A summary of several cold knowledge of the shell (IFS, arrays, substitutions, splits, lookups)

Ifs:A direct description of the usefulness of IFS, details of what ifs is doing ... Self GoogleFirst create a file of "a", and "a":Then we look at LS:--LSA a AIs this.Then if we need to write a script to manipulate each file:--For I in $ (LS); Do

Total Pages: 541 1 .... 320 321 322 323 324 .... 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.