In just learning to write shell batch processing, the logical operation, there is no need to base: arithmetic, here to say in the Linux shell simple implementation method.
1. Simple Method
[Chengmo@centos5 ~]$ b=$ ((5*5+5-3/2))[Chengmo@centos5 ~
Add a Hadoop group
sudo addgroup Hadoop
Add the current user Larry to the Hadoop groupsudo usermod-a-G Hadoop Larry
Add Hadoop Group to Sudoersudo gedit etc/sudoersHadoop all= (All) after Root all= (all)
Modify the permissions for the Hadoop
Three, Shell script Development Basic Specification
System functions in 1,/etc/init.d/functions action using the method:
Show XXXX, and the right side shows the green OK Word: action "xxxx"/bin/true
Display XXXX, and the right side shows the red
Introduction Enterprise Shell interview question: Master please detour! Enterprise Practical Problems 6 : developing shell scripts to solve DOS secure Linux server production casesaccording toWeblog or the number of network connections, monitor when
Sometimes in the initialization shell script you want to be able to create a user and specify a password, you can use the Useradd command to achieve this effect:useradd -m -p encryptedPassword usernameParameter description:
-M:
68. Logical judgment in shell script, file directory attribute judgment, if special usage, case judgmentI. Logical judgments in shell scriptsFormat 1:if condition; Then statement; FiFormat 2:if condition; Then statement; else statement; FiFormat
background:The database audit platform for Group self-research has implemented the ability to pull Oracle database performance reports in a single click in a Windows environment.Recently received the small task of the Audit platform development: The
Fifth. Definition, execution, parameters and recursive functions of shell functionsBash (Bourne Again Shell) also supports functions, when writing large complex scripts, you can use functions to write code into a function of a relatively independent
variable names do not add dollar signs when defining variables, such as:# Myname=sxzhouAttention:There can be no spaces between the variable name and the equals sign, which may be different from any programming language you are familiar with. At the
Shell programming in the 2nd Chapter of Shell script Getting Started1. What is the shell?The shell is a command interpreter that interprets commands and programs that execute user input, is responsible for direct conversations with the user,
If statement 1.1 if statement explanation
If is a judgment statement, if the action is similar to [], the general judgment is more or the execution of the statement is more, then will use if
1.2 If format
First format
if [
Reference: Linux commands, editor and Shell programming, advanced Programming for UNIX environmentsReferenceThe bash shell commands are divided into two categories: external commands and internal commands.
1. Invoking system commandsThe Exec package executes the external command, which will be OS. The startprocess is packaged to make it easier to map to stdin and stdout and to connect I/O with pipefuncstring, arg ...string) *Cmd {}Call system
your door often opens ~ ~ ~ Lao Wang Please come in ~ ~ (be cautious of the current directory. Join path)Often hear people say don't put. (current directory) to join the path, in the end why, I think of many times also surf the internet for half a
Shell Script Debug Print log issue 1. DemandWhen we write scripts, sometimes we need to do debugging, so that we can locate the problem, and sometimes when the script goes online, we need to keep the records during the execution of the script. It
In some complex Linux maintenance work, a lot of repetitive input and operation is not only time-consuming and error-prone, but writing a proper shell script, can be batch processing, automating a series of maintenance tasks, greatly reducing the
Directory
JavaScript Shell Learn to share
Brief introduction
Installation
Use reason
Summary
JavaScript Shell Learning Sharing Introduction
JavaScript Shell is part of the comprehensive
70. Function in shell, array in shell, demand analysis of alarm systemI. Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit
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.