Gitbook Installation:
Download Node.js source code (click on the Green install),
Extract
./configure Make
After successful execution, NPM is installed.
2. Gitbook installation command
NPM install-g GITBOOK-CLI
A, Shell conditional statement (if usage)
If statement structure [IF/THEN/ELIF/ELSE/FI]
Copy Code code as follows:
If condition test statement
Then
Action
[Elif condition
Action
Else
Action
]
Fi
If
One, while loop
The while loop is used to continuously execute a series of commands and to read data from an input file; a command is usually a test condition. The format is:
Copy Code code as follows:
While command
Todo
Command1
"Note 1": unlike Java, PHP and other languages, SH's process control can not be empty, such as:
The code is as follows:
You can't write this in Sh/bash, if the Else branch has no statement execution, don't write this else, like this:
If
Content directory: Find file lookup grep text Search xargs command line parameter conversion sort sort Uniq eliminate duplicate rows with TR convert cut by column split text paste by column stitching text WC statistic lines and characters tool sed
Introduction to Shell Script (bash)
As is known to all, Unix is famous for its gadgets, using a number of simple gadgets to accomplish a job that would otherwise require a lot of software development, making UNIX the ideal system platform for many
basename example.tar.a.b.c.gz. c.gz
# => example.tar.a.b file= "
example.tar.gz"
echo "${file%%.*}" Fetch Head Example
# => example
echo "${file%.*}" go tail example.tar.a.b.c
# => Example.tar
echo "${file#*.}" Go head
The purpose of this script:
Mainly used to monitor the Linux VPS server load and memory footprint, such as MySQl, PHP-FPM, when the load or memory consumption reached the set value, it will automatically restart the process to avoid downtime.
The
Original: http://blog.csdn.net/iamlaosong/article/details/54728393
Recently, to compile a shell script to process the data, you need to detect the existence of the data file, the file name contains the date, so you need to generate the date of the
The Linux shell can be user-defined functions and can be called casually in shell scripts. Here's how to define it, and what to call attention to.I. Defining shell functions (define function)Grammar:
[Function] funname [()]
{
Action
Simonsu
Blog
Comment Wall
Reader Wall
Link
About
The SH scripting syntax in LinuxPlaying Linux all know the convenience of SH script, but how to write sh script is a novice and rookie problem like me. It is one thing to
Command-line arguments(Transferred from Http://c.biancheng.net/cpp/view/2739.html)
List of special variables
variables
meaning
$
File name of the current script
$n
Arguments passed to
Anti-QuoteThe anti-quote bit (') is located above the TAB key of the keyboard, to the left of the 1 key. Note the difference between the single quotation mark (') on the left side of the ENTER key.Plays the role of command substitution in Linux.
A matter of note1. The beginning of a script behavior:#!/bin/bashdeclare the name of the shell that this script requires2. "#!" is out of the program Other than the one that starts with # is the comment content3. For the use of the system command,
The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that
Objective:Add Linux user account, this is relatively simple, in the face of the cluster, many machines, how do we do and implement? This short article, briefly explain some ideas, as far as possible to involve some of the surrounding knowledge
Shell DesignThrough the design of shells, we can learn more about the use of constructors and the use of containers. At the same time, it may be necessary for the reader to recall a little bit of the trigonometric functions learned in junior maths,
From the programmer's perspective, shell itself is a program written in C language. From the user's perspective, shell is a bridge between the user and the Linux operating system. You can enter commands for execution and use shell script programming
Here we will first introduce the basic syntax of shell, including the beginning, comment, variables, and environment variables, however, laying a good foundation is a prerequisite for easy learning in the future.
1. Linux script compiling Basics
◆ 1.
Linux login & non-login shell and su, sudo related concepts, linuxlogin1. login & non-login shell
In Linux, the kernel will create the init process to perform a series of system initialization operations. When a user logs on to the shell, the
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.