Write Ngin startup script with Shell

#!/bin/bash[-f/etc/init.d/functions] &&. /etc/init.d/functionsPid=/application/nginx/logs/nginx.pidNginx=/application/nginx/sbin/nginxRed_color= ' \e[1;31m 'Green_color= ' \e[1;32m 'Yellow_color= ' \e[1;33m 'Blue_color= ' \e[1;34m 'pink= ' \e[1;35m '

Linux custom Shell functions and function libraries

Under the Linux system, Shell scripts can help us in a variety of situations, such as displaying information, even automating specific system administration tasks, creating simple command-line tools, and so on.In this guide, we'll show Linux novices

shell-Regular Expression

One, regular expression. Represents any single character650) this.width=650; "height=" src= "http://b287.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/ sdbj9wszq8xdepnsuukfasw8eaay*4jnuepopfpw.oo!/b/db8baaaaaaaa&bo=eaeoaqaaaaafeeu!

shell-grep-sed Common usage

grep-a digital search to show the next line of information650) this.width=650; "height=" 290 "src=" http://b176.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/

Summary of SHELL commands from beginner to small white

Summary of Common shell commandsThis article summarizes some of the common shell commands, hoping that Linux small white like me in the familiar with these commands, can basically cope with the small white phase encountered problems1.cdAfter the CD

Bash Shell First lesson

Self-taught shell, and was taught by the teacher, English class do not study English four how to live, haha, that there is no data on my attractiveness, ah, for love and dream!!!Recall the file format: filename with an. sh extensionFile content at

Shell Script debugging

Bash is the default scripting language in a Linux system, and since it is a programming language, debugging of scripts is essential. Here's a simple debugging approach to bash:1 using Bash's parameter-X, such asBash-x a.sh+ for A in ' bafa{1..4} '+

2. Shell Programming Exercise II

Design a shell program, add a new group to Class1, and then add 30 users belonging to this group, the user name in the form of Stdxx, where xx from 01 to 30!#/bin/bashgroupadd class1 for i in {1..30}do   if [  $I

Shell instance (i)

Shell instance (i) Example one: equals-eq (equal)Unequal-ne (not equal)Greater than-GT (greater than)Smaller than-lt (less than)Greater than or equal to-ge (greater than or equal)Less than or equal to-le (lesser than or equal)Examples

HBase Learning Notes-hbase Shell common commands

Limit the number of rows when you sweep a table' table_name ' 5 }When the table is scanned, only five data is specified==============================================Delete TableThe deletion of the table requires the implementation of two steps,

Nginx Log Cut shell script

####### My Shell Code ##############! /bin/bashDate= ' Date +%y%m%d 'Logpt=/root/nginx/logs/access.loglogbk=/data/ng_log/$dateLogpid=/root/nginx/logs/nginx.pidlogtag= $LOGBK/' Date +%y%m%d%h%m%s 'if test! -D $LOGBK; then mkdir-p $logbk; fiTest-f

Shell Preliminary understanding

Type of shell View the shell program used by the user, the Seventh field in the/etc/passwd file (as if it were the last one, mainly the bash shell) There is also a default shell of/bin/sh, which acts as the default system shell for

Shell ———— Regular expression Basics and sed

What is a regular  A regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things.In Linux, wildcard characters are

Linux Base-shell Script

Task one goal: Automatic deployment, initial configuration, and start Nginx reverse proxy serviceSplit the task-the Automatic Deployment section is the first to download the installation NginxFirst, create a very NB-domineering catalogue and a

Linux Shell-tail

Use tail--help to view commands for memotail [-f] [-c number |  -N Number |  -M number |  -B number | -K number] [File]Usage:tail [OPTION] ... [FILE] ...Print the last ten lines of each FILE to standard output.With more than one file, precede each

Loop of shell scripts: repeating commands

Loop of shell scripts: repeating commands1.for CycleGrammar:For variable name in variable Value listDoCommandDoneFor based on the contents of the variable Value list, executes the command repeatedly until all the contents of the Variable Value

Shell Basics (ii) Cut usage

Shell Basics (ii) Cut usageSyntax: cut-d ' delimited character ' [-CF] n-D after specifying delimiters , single quotation marks, must be a single character-f Specifies the paragraph, which can be separated by commas with multiple numbers-C is

Shell some methods

String interception from the original address: http://www.jb51.net/article/56563.htmOne: string interceptionThere are VAR variables:var=http://www.aaa.com/123.htm1. # Intercept, delete the left character, leave the right character.echo ${var#*//}Www.

Shell Basics (iii) Sort usage

Shell Basics (iii) Sort usageSyntax:sort [-t delimiter] [-KN1,N2] [-nru]Here n1-T followed by delimiters, acting like cut-d,-N uses a purely numeric sort, only for numbers, and if it's a letter, it's handled by 0 .-R Reverse Sort-U to repeat-kn1,n2

Get the time of the previous day and the use of the Shell's ${!3} and eval

Example 1:[email protected] opt]# cat a.sh #!/bin/bashsource/opt/b.txtaa=${!1}echo $AA [[email protected] opt]# cat B.txt Abc=1[[em AIL protected] opt]# sh a.sh ABC1Example 2:[email protected] opt]# cat a.sh #!/bin/basha=1b=aecho ${b}echo ${!b}eval

Total Pages: 541 1 .... 452 453 454 455 456 .... 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.