#!/bin/sh#mysql Address # Detects if the user entered the password manually mysql_host= "" #mysql用户mysql_user = "" #mysql密码mysql_password = "#mysql数据库名 # If you do not fill in the database name you want to export the error message and terminate
Determine if b.txt This file exists, there is output 1, there is no output 0[-F B.txt]&& echo 1| | Echo 0-F: Determines whether the file is-E: Determine if the file exists-D: Determine if the directory-R: Judging whether it is readable-W: Determine
1, test: the detection of the expression is established, the return value is 0, otherwise, not 0Method:1) test expression2) "Expression"2. File test:-D: Whether it is a directory-F: Whether it is a file-E: whether there is-r: Whether Read permission
Conditional test Syntax:Syntax 1:test This is the method of conditional test expressions with the test command.Syntax 2:[]: This is the way to test an expression with a single parenthesis, as with the use of the test command, the recommendedSyntax 3
One: Word accumulationCurrent: currentlyDirectory: Directories Entries: ArticlesDefault: DefaultsInformation: InformationFormat: FormattingIgnore: NeglectLicensing: LicensingTwo:1.GNU Bash Description: The shell is the user interface of the Linux
Five week fourth session8.6 Pipe symbol and job control8.7/8.8 Shell variables8.9 environment variable configuration file8.6 Pipe symbol and job controlPipeline compliance with Job controlTasks to stop: jobsMove the task to the front desk: FGTask is
A file test is a test of whether a file or directory existsTest file format [operator directory or file] Note that there is a space between the opening parenthesis and the operator, and there is a space between the file or directory and the
Tput commandtputYou can change terminal features, such as moving or changing the cursor, changing text properties, clearing specific areas of the terminal screen, and so on.Cursor PropertiesIn a shell script or command line, you can change the
Native bash does not support simple math operationsWhen you are beginner, you can use $ (()) and expr to implementUse $ (()) to achieve:#!/bin/bash# file name: Test.shecho $ ((1+3)) #命令行第2个参数和第3个参数求和 # At this point the + number can be added without
SED replaces a string in a fileSed-e ' s/foo/bar/' myfile replaces the first occurrence of each line in the MyFile file foo with a string bar , and then outputs the file contents to the standard outputSed-e ' s/foo/bar/g ' myfile g allows SED to
number of logged-in users: who | Wc-l
See which users are logged on to the system : who
Create a new file /bin/ct11, enter a command in the file,chmod Set the Execute permission for the file
# cat >/bin/ct11W.H.O. | Wc-lPress Ctrl+d# Cd/
Test statement format: [conditional expression]A few common forms:[-D/ETC] to determine if/etc is a directory type,[-e/etc/php.ini] Determine if the/etc/php.ini file exists[-f/etc/php.ini] Judge/etc/php.ini is not a general
$ default variable in 1.shell
$n $ $ for the first argument, and $ for the second argument ...
$# Number of command-line arguments
the name of the current program
$? The return code of the previous command or
Shell Process ControlUnlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):PHP if (Isset ($_get["q"]) { search (q);} Else { // don't do anything }You can't write
$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.$ echo the last Sunday was $ (date-d "last Sunday" +%y-%m-%d)Get the date of the previous SundayThe reason for using $ ()
' (anti-quotes) is
Enterprise Practice Question 16:Enterprise Case: Write Network Service standalone process mode rsync system startup scriptFor example:/etc/init.d/rsyncd{start|stop|restart}.Requirements:1. To use the System function library technique.2. To use a
Shell after class summary
High wavesArchive: Learning NotesDecember 4, 2017 13:31:08
Shortcut keys:Ctrl + 1 title 1Ctrl + 2 title 2Ctrl + 3 title 3Ctrl + 4 ExampleCtrl + 5 Program CodeCtrl + 6 Body
Format
Introduction to ArraysBash provides only one-dimensional arrays, and does not qualify the size of the array. Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the array to take advantage
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