In the shell script to do a variety of tests frequently, test the format of the statement:
(1) Test
(2) [
(3) [[
Three kinds of differences, in the third can be a wildcard matching, and &&,| |,, the operator can also be normal presence in [[]],
The benefits of using an if statement in a shell script are: You can decide whether to perform an action based on a specific condition (eg: determining whether the backup directory exists), and perform different actions when different conditions are
#!/bin/bash
#-------------------------Haproxy Server Management Shell script------------------------------------------------
#Authors are from JC
#time: 2012-10-10
#QQ: 408822635
#from the region Beijng.china.
#-------------------------Haproxy
Here I will first describe what a shell is, and then introduce my first shell program and summarize the experience from it.
First, what is the shell
Before talking about my shell program, I would like to talk to you about what is shell, I believe
0. Initializing the Environment and OLE objects
#include #include // 初始化COM环境CoInitialize(NULL);// 创建Shell对象Variant vShellOLE = Variant::CreateObject("Shell.Application");
1. Cascade windows
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
Dynamically analyze Maillog logs with shell scripts to disable malicious IP firewallSystem environment: Centos 6.5 x64Postfix mail system installed, found Maillog too many "SASL LOGIN authentication failed" Junk IP address. This script is used to
When tapping the code, it is often possible to print some progress or log information properly to help us track the execution of the program. However, these results or the log printing information to the screen is not a basis for future inspection
HBase shell command.
Enter HBase Shell Console$HBASE _home/bin/hbase ShellIf you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell to enter the
Three ways to start bash shell1, log in as the default login shell2. Interactive shell as a non-login shell3. As a non-interactive shell for running scriptsFirst, login shellWhen you log in to a Linux system, the bash shell starts as a login shell,
---restore content starts---File test expression-F file exists and is a normal file-D file exists and is a directory file-S file size is not 0 true-e file exists then true-R file is saved and readable #文件属性对于root有时不好用-W Write-X execution-L exists
As a Linux little white, just learn a little bit to remember:When deploying the server. It is often necessary to view the console output as a local, to be able to view the log output in Linux, and, of course, to have the log displayed in real time
#/bin/bashBefore you start the shell script, be sure to add the above sentence at the beginning of the script and write it with your head, without spaces and blank lines ahead of you. This means telling the system which shell to use to execute the
Tag: Replace pattern match shell variable assignmentShell variable assignment and environmentToday, with the architect (Fan) doing a code-count script, I learned the following:1) command in script, just string, longer command can be changed to
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
Note: Different versions of Linux will differ, but they are very similarThe Linux command obtains the input from the standard input device (stdin) By default, outputting the result to the standard output device (STDOUT) display. In general, the
The printf command is used to format the output and is an enhanced version of the echo command. It is a finite variant of the C-language printf () library function, and is somewhat different in syntax.Note: printf is defined by the POSIX standard,
Here document usage for Linux shell (cat What is here Documenthere Document is a special redirection method in the Linux Shell, and its basic form is as follows CMD its role is to pass the contents of the two delimiter (Here Document content section)
A. Shell command1. Enter the HBase command line./hbase Shell2. Display the list of tables in HBase3. Create a user table, including info, data two column familiesCreate ' user ', ' info ', ' data 'Create ' user ', {NAME = ' info ', VERSIONS = ' 3 '}4
The first question: how can I pull my local warehouse code to the GitHub site?Git push Origin masterwarning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.To Github.com:lanshanxiao/yunweather.git! [Rejected] Master--
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