Use the-e parameter of MySQL can perform various kinds of SQL (create, delete, add, erase, change, check) and other operationsUsageMysql-uxxx–pxxx-e "MySQL Command" Of course, you can also use the following notation MYSQL-E-uxxx–pxxx "mysql
Sometimes the shell has a variable number of arguments, want to get the 2nd bit after the argument, as a new entry to invoke other scripts the usual way to think of this is to use traversal, for example, the following method:For ((i=2;i DoEcho $i
Reference from Linux command DaquanTo see if the shell command is a shell built-in command, use the type to determine:
$ Type cdCD is a shell builtin$ Type pingPing is/bin/ping
All built-in commands are as follows:ShThe
One, do not want to manually enter the method1. Install expect tool: sudo apt-get install tcl TK expect2. The contents of the script file are as follows:#! /usr/bin/expectSpawn sudo apt-get updateSend "zhoushuo\r"InteractSecond, want to manually
The first time to write shell scripts, no experience, is to write directly, or to go through the process ( ̄▽ ̄) ~*-----------------------------------------------------------------------In general, three steps, let's do it with me.---------------------
One: The type of shell that stands in terms of user login:Login Shell: Normal usually a terminal login Su-usernamesu-l USERNAMEOpen Command Window under non-login SHELL:SU username graphics terminalTwo: Bash configuration file:Global
Personal configuration is mainly concentrated in the ~/.profile file.When you open a new interactive shell, the order in which the configuration files are executed is/ETC/PROFILE/ETC/BASHRC ~/.profile and finally ~/.BASHRCEnvironment variables--can
Shell reads each line of the fileWriting one:----------------------------------------------------------------------------#!/bin/bashWhile Read lineDoEcho $lineDone ----------------------------------------------------------------------------Two:------
DirectoryFirst, Shell Basic use of scripts1. Language Specification2. Variables3. Redirect (>,>>)Second, operators and common judgments1. Comparison operators2. Logical operators3. Common JudgmentsThird, the program structure1. Branch (if statement)2
IDC small rookie one, non-trained. There are often customers with CentOS servers that need to allocate 15 IPs or even 30 IPs. Each time a manual assignment was cumbersome, it took a day to learn the shell script and write the
In Linux, if the file name is enclosed in parentheses, the parentheses should be processed first, preceded by "\" before "(" and ")". Bracket_handle gives the processing method:Sub Bracket_handle {My ($tmp _name) = @_;$tmp _name =~ s/\ (/\\\ (/g; # (
Under the Linux system, Shell scripts can help us in a variety of situations, such as displaying information, even automating specific system administration tasks, creating simple command-line tools, and so on.In this guide, we'll show Linux novices
The case statement and the judgment statement [If...elif...else] function similarly;When logic is relatively simple, the code is much less than the latter.Case usage, use a variable to match a value, if the match succeeds, execute the command below
Shell instance (i)
Example one:
equals-eq (equal)Unequal-ne (not equal)Greater than-GT (greater than)Smaller than-lt (less than)Greater than or equal to-ge (greater than or equal)Less than or equal to-le (lesser than or equal)Examples
Task one goal: Automatic deployment, initial configuration, and start Nginx reverse proxy serviceSplit the task-the Automatic Deployment section is the first to download the installation NginxFirst, create a very NB-domineering catalogue and a
Automated deployment and monitoring of development scripts1. Scripting automatic deployment of reverse proxy, web, NFS;Requirements: I, the deployment of Nginx reverse proxy three Web services, scheduling algorithm using weighted polling;II, all Web
Bash features multiple command executions, such as: # COMMAND1 $ (COMMAND2), and communication between Processes (IPC): # COMMAND1 | COMMAND2 ...I. Command execution structure and algorithmIn command execution, there are sequential execution
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