Shell Script
Just do it, simply write a Shell script and it's done!
Script Name: Web site dead chain generation script
Script function: Daily analysis of the site the day before the Nginx log, and then extract the status code of 404 and UA for
From:http://www.cnblogs.com/aaronwxb/archive/2011/08/19/2145364.htmlWriting a script yesterday took 2/3 of the day, and most of the time spent on the SED command, today do not summarize the time of yesterday, I'm sorry.There are several commands for
for commandfor Var in listDoCommandsDoneCode 2-1[Email protected]:/data# cat demo1 #!/bin/bashfor test in Alabama Alaska Arizona Arkansas ' California Colorado ' do Echo "The next state is $test" Doneecho "The last state we visited be $test"
The full name of IFS is Interal Field Separator, the "inner Zone delimiter", which is also a built-in environment variable that stores the default text delimiter, which by default is a whitespace (space character), tab (tab), and New lines ( NewLine)
Bash is Bourne Again shell abbreviation, developed from the UNIX system shView current ShellEcho $SHELLView system-supported shellsCat/etc/shellsCd/binLs-la *shFirst, the bash shell configurationVariables can be divided into custom variables and
Help Desk Meet Power Shell2015-12-14 16:58 Microsoft China TechNet Read 397Share with you some of the views of desktop support and power shell.Desktop technology Support, at first more mechanically repetitive single operations, such as the
Until cycleThe environment used to perform loops when a proposition is falseWhen a proposition is false, it enters the loop; exit the loop when the proposition is trueOr if the condition is not satisfied, enter the cycle of the sceneIn logical
Before we write, let's figure out why we need to learn the shell and learn to be purposeful.The shell is simple, flexible, and efficient, and is especially suitable for dealing with some minor system management issues.Shell automates management,
I. The history of the shellThe role of the shell is to explain the execution of the user's commands, the user enters a command, the shell interprets the execution of a bar, which is called Interactive. The user also has a way of executing a command
The role of Eval is to perform command-line processing again, that is, to perform two command-line processing on a single command line.1. Example 1: Using the eval technique to implement the shell's control structure forUse the Eval technique to
Scripts are best placed in/usr/local/sbin.the script executes the Sh-x script. Sh-x can view the execution process1 when using variables in a script, use the $ symbol:#!/bin/bash# #把命令赋值为变量, you need to use anti-quotesd= ' date + '%h:%m:%s 'echo
Reprint: Http://zhidao.baidu.com/link?url=th2hdLX2aijSiiOJJStShdBmfoxNQSTzKM12rFW6IqlL93uijQ7jMkK8V9fEFuuOp5Ni1VxKRapzFvCgCWozKaFile comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a
Recently relatively busy, in the company wrote a Centreon+nagios platform source automatic installation script (because the company can not even outside the network, the company Yum source a lot of things are not all, so can only take the source
Linux Remote Execute shell commandIn a Linux system, we often want to execute a shell command on machine B on a machine.The following scenario is a popular and reliable solution.1.SSH Login without password# Local server execution (a machine):
There are several ways to bash a shell script, and now make a summary. Suppose we write a good shell script with the file name hello.sh and the file location in/data/the shell directory and has execute permissions. Method One: Switch to the
1. CutUsed to segment a fileCut-d ' delimiter ' [-CF] n-d Specifies the delimiter followed by single quotation marks.-F Specify paragraph-C is followed by a number that indicates the intercept of the first few characters, followed by a number area,
In general, the programming language can be divided into two categories: the compiled language and the interpreted language.Compiled languagesMany of the traditional programming languages, such as Fortran, Ada, Pascal, C, C + +, and Java, are
Tag: Shell finds the maximum value in an array elementHow does the shell compare the maximum values in all the elements in an array? Such as:array= (111 222 333 444 555 999 888 777 666) How to find the biggest element 999?Idea: Set a value
Install the SSH secure Shell under Windows. There are two shortcuts after the default installation.Need to install Openssh-server under LinuxUtuntu installed by default opens is-client, so do not need to install, but if not installed, then use
This note is for the early ximo of the shelling Basic video tutorial, organized notes. the tools used in this note:http://download.csdn.net/detail/obuyiseng/9466056TelockAction 1. Last Exception Method 1, Option---DEBUG
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