I. Declaration and reference of variables in the shell[[email protected] ~]# Var1=hello[[email protected] ~]# echo $var 1hello[[email protected] ~]# echo ${var1}worldhelloworldIn the shell, a reference to a variable uses $.In the above code, $var 1
General work to deploy a new server, deployment completed also add Zabbix monitoring, so install Zabbix client is very frequent, I wrote here a simple automatic installation script, not very perfect, but also can be used in peacetime.The script may
Section III: The wording of conditional judgmentIf conditional judgment, the "conditional judgment" in the grammatical structure of if can have many forms. The test result is true, just to see if it returns a value of 0.The following 10 types of
Arithmetic operations in the shell require no spaces between numbers and operators;Special symbols do not need to be escaped;If the arithmetic expression contains other variables, you do not need to use the $ reference;General arithmetic operations:+
There is a HIVE-E command in hive that can pass parameters, but when the HQL statement is more, the entire shell script will look messy, of course someone might say hive-f can implement a direct call to a file,bingo indeed, but there is a big flaw,
The Cut command is the next powerful tool in the shell, it is a processing object with each behavior, can be a row of strings for a variety of pattern matching cutting operations, you can also operate on a well-organized text, let's say cut this
Comprehensive use of special variables and scriptsfirst, environment variables :ENV # #查看所有的环境变量Echo-e "1\n2" # #换行显示Echo-e "1\t2" # #在1和2之间加入tab显示Echo-e "\033[44;37;5m me\033[0m COOL" # #有颜色显示, "\033[" is the terminal escape character startEcho-e "$
Entry
Awk and Bourne shell are the basis of POSIX shell
In addition to the POSIX standard, there are European x/open standards
Two types of regular expressions
BRE basic Regular Expressions basic grep use
ERE
In the recent work, the product group of colleagues to give the data are all lowercase letters, but the engine team colleagues asked them to get from the data inside the structure of the analysis is all capitalized structure, which makes our data
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):
Examples are as follows: Batch create 10 random string of files, require each file name after adding _aaa, suffix name unchanged;[[email protected] goodboy]# lsadddbbdedf.html baacjaiija.html bhcfaabcfh.html dgjdcdfbca.html efejadfdji.htmlagdhcdeaje.
Let's review the usage of the last section redirect:1. Quickly empty filesCat Demo.txt Note: Linux has a classic saying "Everything is a file",/dev/null can be considered a special empty file, more image point, can be understood as a sci-fi film in
The shell is a programming language, a command interpreter, which is the kernel that interprets the commands we enter.He is divided into two types, the interactive mode is that the shell waits for your input, and executes the commands you submit;
The simple thing is to write some shell syntax and commands in it, plus regular expressions, pipeline commands, and data flow redirection to achieve the purpose we want.Shell scripts is a good tool for system administration, but it is not fast
Conditional judgment is the basis for a program to gain intelligence, while the Bourne shell script simulates conditional expressions in most programming languages by command.The control structures supported in the shell are:(1) If then else fi(2)
DemandWhen writing gadgets, you often encounter the need to check things out of MongoDB, because you want to use it in conjunction with other bash toolchain, so the best way to do this is to execute the query on the shell and then pipe it to the
Variable Description: $$ the PID of the shell itself (ProcessID) $! PID of the Shell's last running background process $? end code of the last Run command (return value) $- flag at a glance using the SET command $* all parameter
#! /bin/sh#shell script takes care of starting and stopping# The GlassFish DAS and GlassFish instance.## Chkconfig:-64 36# Description:tomcat Auto Start#/ETC/INIT.D/TOMCATD# Tomcat Auto-start# Source function library.#. /etc/init.d/functions# source
An associative array of shellsThe Shell associative Array bashi has no native support for similar hash table, unlike Perl or Python. The subscript array element is accessed by an array subscript (an array subscript can be an arithmetic
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/9466056Introduction:the FSG shell is a compression shell. We use 9 ways of shelling
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.