If
Single-format and nested
if conditional expression; then #当条件为真时执行以下语句 command list else #为假时执行以下语句 command List fiif Statements can also be nested using an if condition expression 1;then if condition expression
One, the file operation1. Expression-D: Whether it is a directory-F: Whether it is a file-E: Whether the file or directory exists-R: Whether the current user has Read permissions-W: Whether the current user writes permissions-X: Whether the current
Http://blog.chinaunix.net/uid/21411227/cid-63616-list-1.html1. Determine the file type –b Returns True when file exists and is block -C Returns True when file exists and is a character -D returns True when pathname exists and is a directory -E
1. Find in the -exec Parametersin the current directory ( including subdirectories ), find all txt files and find the string "Bin" containing the the lineFind./-name "*.txt"-exec grep "bin" {} \;in the current directory ( including subdirectories
The shell can recognize 4 different types of cited symbols: single quote character ' double quote character ' backslash character \ anti-quote character '
1. Single quotation mark (')# grep Susan PhonebookSusan Goldberg 403-212-4921Susan Topple 21
#!/bin/bash # # ip_check This shell script takes care of checking all IPAddress. # # Create by Xuekun # date 2015-12-6 # Beijing Open Source # source function library. ./etc/rc.d/init.d/functions App_path= ' pwd ' Log_path=${app_path}/ip_
Original blog, reproduced please indicate the sourceThe shell is the command interpreter.See which shells are supported by this system1 Tab Command completionThis can be used almost every time, for example, I have a file called file.txt, if only one
At the user's point of view, there are two types of shells:log-in Shell:Log in normally via a clientSu-username or Su-l USERNAMENon-logon shell:Su USERNAMECommand window open under graphical terminalShell scripts that are executed automaticallyBash
At the user's point of view, there are two types of shells:log-in Shell:Log in normally via a clientSu-username or Su-l USERNAMENon-logon shell:Su USERNAMECommand window open under graphical terminalShell scripts that are executed automaticallyBash
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
1. {} curly braces:usage One: Wildcard extensionEg:ls my_{finger,toe}sThis command is equivalent to a combination of the following commands:ls my_fingers my_toeseg:mkdir {Usera,userb,userc}-{home,bin,data}we will get Usera-home, Usera-bin,
Functions are often used when writing programs, and general development tools have a rich library of functions. But sometimes you need to customize the function to meet our needs.In Linux, the same is true for shell scripts, which sometimes use
The format of the statement is: Getopts The general format is:Getopts option_string VariableWhere option_string contains a valid single-character option. If the getopts command finds a hyphen on the command line, it is compared with the word
The case name in the shell under Linux is similar to the switch in C + +, but the cases in the shell are more powerful and complex.
1, strong mainly reflected in: Shell in case the keyword can be a string type, and each item can contain regular
if logic judgment in shell scripts
Logical judgment Expression:
-GT (>); Greater than great than
-lt (=); Greater than or equal to
-le (
If logical judgment format:
Format 1:if condition; Then statement; Fi
format 2:if condition; then
This article mainly introduces the basic syntax of if and common judgment usage in the shell, this article explains the basic syntax of IF, the judgment of the string, the judgment of the number, the judgment of the file attribute, the logic
-silent is used to eliminate the default display of Sql*plus and database version information   when the login Sql*plus is connected to the database, and also removes the display prompt. can be shortened to-sset pagesize 0
Recently learning a Linux script, here is the meaning of $, $, $!, etc. in shell scripts
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
first, the basic operation of the databaseshow databases; List databasesUse database_name; Using the database_name databaseCreate Database Data_name; To create a database named Data_nameDrop database data_name; Delete a database named Data_name:Use
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.