Install the Ansible batch management system. (No, SSH remote command loop is also possible)
Create a new table in a common database, using the information you want to collect as a column name, and provide the ability to insert with the shell.
Shell variables are used to store the specific parameters (values) that the system and the user need to use, and these parameters can vary according to the user's settings or changes in the system environment."The role of variables"Provides specific
1. BackgroundThe Linux shell is a basic skill, often replaced by scripts such as Python, because of the weird syntax combined with poor readability. Since it is the basic skills, it is necessary to master, after all, the process of learning shell
Shell substitution operators and pattern matching operatorsSubstitution operators:(1) ${varname:-word}: If varname exists and is not NULL, its value is returned, otherwise, word is returned.(2) ${varname:=word}: If varname exists and is not NULL,
Use Let, (()), or [] for basic integer operations, using expr and BC for advanced operations, including decimal operations.[Email protected] tmp]# str= [[email protected] tmp]# let str=str+6[email protected] tmp]# let str-=5echo $str11You can also
1. Function IntroductionFunctional function is a block of statements consisting of several shell commands for code reuse and modular programming.It is similar to the shell program, but it is not a separate process, it cannot run independently, but
Easy-to-make errors with shell scripts1. For i in X y z: This sentence is delimited by a space, and when our $n contains spaces, there will be errorssuch as for i in ' LS *.mp3 ', this ls *.mp3 after execution if there is a space on GGDirect for I
[Email protected] wyb]#CatUser10.SH #!/bin/bash# Batch creation of 10 system accounts wangyb01-WANGYB10 and set the password (the password is a random 8-bit string). >user.list forUserinch`seq-W Ten` Douseradd wangyb$user Password=`Echo$RANDOM
Parameters:-N does not execute script, only checks syntax for errors-V Output the script contents to the screen and execute the script-X executes the script and outputs the content to the screen-N-VTen module () { eval '/usr/bin/modulecmd bash $*'}#
Transferred from: http://my.oschina.net/u/189445/blog/595232Two months ago used HBase, now the most basic commands are forgotten, leave a reference ~
HBase shell command
Describe
Alter
Modify Column family
I. Command substitutionA. in Bash, $ () and ' (anti-quote) are used for command substitution.B. command substitution is similar to variable substitution, which is used to reorganize the command line, complete the command line in quotation marks, and
How the Linux shell commands work:Linux is strictly speaking of an operating system, we call it "core (kernel)", but we generally users, cannot directly use kernel. Instead, it communicates with kernel through kernel's "shell" program, the so-called
The grep command in the Grep:linux system is a powerful text-search tool that uses regular expressions to search for text and print matching lines. grep is a lookup filtering tool in which regular expressions find strings that conform to patterns in
Shell-7.shell Use of strings1. View the length of the string${#var} to calculate the length of the variable value:[Email protected] ~]# var= ' Yuanji '[Email protected] ~]# echo ${#var}62. Further discussion of single quotation marks, double
This article takes the shell from getting started to giving up the first stepThus, continue from small white to give up the second part of @[email protected]
First, the shell operator
The shell supports a number of operators, including:
A shell script that counts CPU memory hard disk usage for everyone to learn reference#!/bin/bash#this Script isUse fordescrible CPU hard memery utilizationtotal=0Idle=0system=0User=0 Nice=0Mem=0vmexec=/usr/bin/Vmstatwhich SAR>/dev/NULL 2>&1if[$?-ne0]
Using the shell module, the remote command is executed through/bin/sh, so we can use the various command methods in the terminal input;But we define our own environment variables in. Bashrc/.bash_profile The shell module is not recognized because it
7.1 Creating and executing shell programs 1487.2 Variables 1497.2.1 Assigning a value to a variable 150The shell uses "=" To assign a variable, or you can change or initialize the value of a variable with an equal sign.7.2.2 Access Variable 1507.3
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.