[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
see how to pass parameters to a shell script today, you need to master two commands, one is the shift command, the other is getopts.
If the expression contains special characters, the Shell will replace it. For example, using a variable in double quotes is a substitution, and an escape character is also a substitution.As an example:
#!/bin/bash
A=ten
echo-
There are two ways to bring the echo output color
Define color variables in shell scripts, use ECHO-E to call variables
When defining a variable, define the ECHO-E in the variable, and then output the variable
Shell script that
Linux under Install configuration msmtp and mutt send mailAuthor: In-field Date: December 11, 2014 Comment (0) View CommentsLinux under Installation configuration msmtp and MuttLinux has the need to send mail, mail is uncertain, because many mail
Open After ESXi ssh , the host summary will be prompted with a warning message ;650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/41/wKioL1R9ZqqhK5iJAACxLMlbQlw096.jpg "/>The solution is as follows :
VSphere Client Log in to
Test whether a large number of servers can ping the pass, if you can ping the pass time ssh up.Prerequisite: A trust relationship is established between the springboard machine and the server to be tested.#! /bin/bashDeclare-a IPip[0]=192.168.30ip[1]
In the Linux production environment, there are the following such a common operations need to work.Every once in a while, such as two hours, the log file to generate the log per second (this is assumed to be testfile.out, the absolute path
/********************************************************************** Author:samson* date:04/18/2014* Test Platform:* Linux Ubuntu 3.2.0-58-generic-pae* GNU Bash, version 4.2.39* *******************************************************************/#
What is a shell:The shell is a human-computer interface, so that humans can control computers, usually have a graphical interface and text interface of twoGraphical interface: Gui:graphic User Interface:WindowsIOS, AndroidX-windowGnomeKdeXfceText
Bash supports many operators, including arithmetic operators, relational operators, Boolean operators, string operators, and file test operators.Native bash does not support simple math operations, but can be implemented with other commands, such as
Recently I have been learning Linux, always feel a lot of learning, but learn and can use a lot of flexibility. Today, when studying VSFTPD, you need to add a built-in user (typically a user with a UID of less than 500) to the/etc/vsftpd/ftpusers or/
After adding some interceptor code, the CPU alarm shows that CPU utilization exceeds 100%.To find out exactly what code consumes too much resources, find a blog post from the Web, reproduced as follows:http://blog.csdn.net/guixunlong/article/details/
Shell is a program for managing and running processes. Next we will simulate a shell program. This instance will better understand the process creation and termination in Linux/Unix systems, and the relationship between parent and child processes.
In Linux, the language setting and localization setting are really complicated, and garbled characters may occur from time to time.
In general, the language displayed in Linux is determined by environment variables.
These environment variables
In Linux, how does one read and write XML using shell scripts? An existing config. xml
XML version = "1.0" encoding = "UTF-8"
?>
Config
>
Server-IP
> 192.168.1.45
Server-IP
>
Server-Port
> 1209
Server-Port
>
Source: http://blog.csdn.net/fox_lht/article/details/5897336
Except for the simplest script, you rarely want to execute every command. Executing a group of commands or repeating a group of commands several times is more helpful than executing a
Note: Here are the shell notes I made. Next, we will provide a series of notes.
Shell is a scripting language, so there must be an interpreter to execute these scripts. Common shell script interpreters in Unix/Linux include bash, sh, CSH, and KSh.
1. first introduce the usage of Alias (alias)
Alias LA = 'LS-a' alias B = 'CD... 'and so on
Alias is a good thing. It can save a lot of time when using shell.
2. But one day I found that the if statement cannot be used when executing the shell
The company uses nagios monitoring to collect the required data through the nagios client and send it to the nagios server. The problem currently is that some of our machines are in another data center, such as China Eastern Airlines, client
Linux Shell Parameter extension (Parameter Expansion), parameterexpansion
The main reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
Other materials:
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