#!/bin/bash# the script is used to configure the Nginx profile syntax highlighting # I've put Nginx.vim on my server. 172.16.0.1, you can go to the official website to download echo ' Get Nginx.vimbye ' | Lftp
IfIn the-ZTo-DThe meaning2011-09-05 10:30[-A FILE]IfFILEThe existence is true.[-B FILE]IfFILEExists and is a block special file is true.[-C FILE]IfFILEexists and is a word special file is true.[-D FILE]IfFILEexists and is a directory is true.[-E
Lines that begin with "#" are comments, which are ignored by the interpreter.There is no multiline comment in sh, only one # is added to each line. Can only be like this:
#--------------------------------------------
# This is a
Linux-bash types of editing languages for script editingInterpreted language (Bash Python perl)definition: Use the interpreter to read the code we write and convert it into system-related commands. Executive advantage: It's easy to deal with objects
Most of the time you don't have to write your own, but see if you can read it together and see an example of less than 10 lines.#!bin/bashgetcontent () {if [!-e $]; then return 1;fi content= ' cat $ ' echo ${content//root/h2do}}getcontent/etc/h
A lot of content is easy to confuse, so it's better to sort out some concepts here.Shell is shell, meaning is a shell outside the operating system kernel, used to interact with the user, which is more commonly used on the server, so do not use the
Code statistics
C Ode as follows:
Xargs Description:Xargs reads the value of the stdin and defaults to a blank or carriage return as a delimiter, passing the split value as an argument to the command-line operation immediately
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 lists. such as "$*" in the
First, the grammarBreak: Used to jump out of a loop. Break N can jump out of a multilayer loopBreakBreak NContinue: Used to skip loops. Continue N can skip multi-layer loopsContinueContinue NIi. details and differences
Break forVar1inch 1 2 3 Do
Use the shell to copy the files under the Windows environment to the usage below Linux.Under Linux, the DOS file format is converted to the use of the Linux file format, vi opens, then goes to the command format, executes, and then saves, which can
1. How the string is converted to uppercase and lowercaseStr= "This is a Bash Shell script."1> TR Modenewstr= ' TR ' [A-z] ' [A-z] ' 2> typesetTypeset-u VARIABLE (convert VARIABLE lowercase to uppercase)Typeset-l VARIABLE (convert VARIABLE uppercase
The r parameter of the LS command represents the recursive listing of all files in all subfolders, 1 means that each row displays only one file or folder, and F means that the output is not sorted, and F indicates that the output of each item is
Core idea: First determine an element interval number gap, and then the sequence of participating in the order of this interval from the beginning of the 1th element into a number of sub-sequences, that is, all positions spaced gap is considered as
Remote SCP file by using reverse CT in shell script: Before using reverse CT, you need to install two RPM packages: # rpm-ihv centos/expect-5.43.0-5.1.i386.rpm
# Rpm-ihv centos/expect-devel-5.43.0-5.1.i386.rpm or yum directly download and install
In Linux, shell variables $ #, [email protected], $0, $1, $2 are interpreted as follows:Variable description:$Shell PID (processid)$!PID of the background process last run by Shell$?End code of the last command (return value)$-Flag overview set by
After openvswitch 2.1.2 is installed, it is often possible to start and stop. To avoid repeating the script to start and stop the terminal code, it is best to write it in a different script to facilitate the next call. The premise is that
Replace the tomcat cluster war package with Shell scripts.
Run the command to log on to the server without ssh.
The configuration file does not change much to overwrite the previous configuration.
Profile configuration file
Bak =/home/wsm/bakWebapps
Linux monitors the running shell scripts of a process and linux monitors shell scripts.
This script scans and monitors the process with the specified process name at intervals of 2. Once the process does not exist, it restarts.
#! /Bin/sh
A =
[Shell] judge the current user
Determines whether the current user is root. If the user is a root user, if not
#!/bin/bash#title: testus.sh#author: orangleliu#date: 2014-08-09#desc: get current user, if it is root user, tell us it is super user or
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