Condition test:To determine whether a demand is satisfied, it needs to be realized by testing mechanism;How to write a test expression to implement the required tests:(1) Execute the command, and use the command status return value to judge;$?:
If you want to find common commands, please click on the imageThe instructions in the shell script, in the uncertain case, do not arbitrarily use nohup, otherwise it may have disastrous consequences, such as-memory explosionShell random function
The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is:While Commanddo Statement (s) to being executed if command is TruedoneThe command
The shell is born in Unix, it is a tool to interact with unix/linux, it is meaningless to learn the shell alone, please refer to the Unix/linux Getting Started tutorial to understand Unix/lunix Foundation.In recent years, the shell has been
This is a Python program, built using Python and mpg123 as the backend. Follow me ...Characteristics:Vim-style smooth operation, support shortcut key binding support for various features such as radio station, collection and so on OS X and various
Remotely copy a file to the specified directory on the specified IP machine:./scp_file.sh/tmp/xx.sh/tmp/test/echo "Copy the file to the $ $ directory!" "For IP in 192.168.60.243 192.168.60.244 192.168.60.245 192.168.60.246 192.168.60.248do scp-r" [
The common check parameters are as follows:Operator If ... True-b file file is a block device file-c file file is a character device file-d file file for directory -e file file exists-F
In a POSIX shell environment, eval is used to remove a string when the parameter option is used, and the effect is the same as "'", which is useful when writing large numbers of references to more complex scripts. The simple use of bash, usually
Metacharacters and descriptions commonly used in regular expressions
Metacharacters
Symbol name
Description
\
Back slash
Escape character
|
Pipeline
Or
[]
File type: Normal file, directory file, socket file, device file, link file
determines whether a file is a symbolic link file. Yes, move it to the/etc directory; No, do not handle it .
1 #! /bin/bash 2 #filename: a.sh 3 filename= 4 echo "Input
Linux+shell obtaining and copying the latest backup dataBefore we introduced some script configuration, today we introduce, using shell script How to copy the most recent files in the specified directory to the specified directory, we copy the files
Linux+shell acquiring and copying the latest data to remote devicesOur remote general copy of the data are created by the shared secret key, so that the copy of the words do not have to enter a password, specifically, I can refer to the previous
Variable, which provides a way for users to store, retrieve and manipulate data.
Environment variables, positional variables, predefined special variables, user-defined variables
Environment variables(1) Shell environment variables, is a class
Suppose that the variable str, when setting or modifying a variable property, does not have a $ number, only a reference variable is used. This means that the variable is str, not $str. $ is just a symbolic form of manipulating variables, as well as
The following hello is the start time, world is the end time#!/bin/Bashstart=$(Date+%s); Hello="20160911 xx" World="20160911"Datebegin=`Date-D"$hello" "+%y%m%d%h"' DateEnd=`Date-D"$world" "+%y%m%d%h"` while["$datebegin"-le"$dateend" ]
You can use the semicolon ";", the double ampersand "&&" and the Double vertical bar "| |" in Linux To connect multiple commands.1.3.1 Semicolon;When multiple commands want to be executed at the same time on a single line, a semicolon ";" can be
Shell Script Planning TemplatesIn Linux operations, shell scripts are indispensable tools, but each operator programming habits are different, many times is to implement a function, written out of the script is rotten seven or eight bad.Scripts must
Recently, because of the development of new features, the programmer needs to quickly add fields to all the tables in a library, so it is simple and quick to use shell scripts to add fields to the bulk modification table.#!/bin/bashexport mysql_bin=/
Create a DS13 server using Windows Power ShellThe Web page is created first:Virtual Cloud Service (ServiceName): Zampdmp-dsVirtual Network (vnetname): az-dmpnetworkTo create a new DS13, the attachment 800G Disk PowerShell command is as
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.