A signal is a mechanism for inter-process communication. It provides an asynchronous software interruption for an application to receive commands (that is, signals) sent by other active terminals ). After an application receives a signal, there are
In shell, what are the special definitions of numbers? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. LOG_DIR =/var/log
ROOT_UID = 0 # $ when the UID is 0, the user has the root user
Interaction with mysql in shell script 1:
[Plain] mysqlCMD = "mysql-h $ {MYSQL_HOST}-P $ {MYSQL_PORT}-u $ {MYSQL_USER}-p $ {MYSQL_PASS}" create_table_ SQL = "CREATE TABLE IF NOT EXISTS $ {MYSQL_DB_NAME }. $ {access_table_name} (id INT (10) not null
Article Title: programming vim + ctags + taglist (ubuntu) in shell ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open
In shell programming, the test command-General Linux technology-Linux programming and kernel information is provided. The following is a detailed description. I just got started with linux and learned the shell programming if command (I have never
The little-known secret in shell command line-Linux general technology-Linux technology and application information. The following is a detailed description. /* Pass the test in linux */
One day, you wrote a very long command.
$ Echo
EXEC command in Shell
1.-exec parameter in find
In the current directory (including subdirectories), find all TXT files and find the rows containing the string "bin"
Find./-name "*. txt"-exec grep "bin "{}\;
Delete all TXT files in the
To test and replace variables in shell, we often need to determine whether a variable exists at some time point. if a variable exists, use the existing settings. if the variable does not exist, give a common setting. (1) If the variable is not set
1. FTP automatically logs in to batch download files.##### From/home/data on the FTP server to the local/home/databackup #####! /Bin/bashFTP-n Open 192.168.1.171User guest 123456.BinaryCD/home/DataLCD/home/databackupPromptMget *CloseBye!2. FTP
1. Use grep (the result is enclosed in parentheses. I wonder if I can match the content in the brackets only)
$ A = 'abc [EDG] adfirpqu '$ echo $ A | grep-O '\[. * \] '# escape [EDG] $ B = 'abc (EDG) adfirpqu' $ echo $ B | grep-O '(. *) '(EDG)
2.
Suppose we define a variable: file =/dir1/dir2/dir3/my.file.txt
You can replace $ {} with different values: $ {file # */}: Delete the first/and its left string: dir1/dir2/dir3/my.file.txt $ {file # */}: Delete the last/and its left string:
The color code is basically clipped between "\ e [" and "m": \ e [32; 1 m
You can use \ e [0 m to disable color output. In particular, when B is set to 1, the highlighted and bold text is displayed.
Common color codes:
Foreground background color
-
In the past, when I was writing code, I encountered a problem with the file path. for example, extract the directory or file name of the file path and determine whether the directory or file exists. every time you encounter such a problem, you
If parameters in Shell in Linux[-A file] true if the file exists.[-B file] If the file exists and is a special block file, it is true.[-C file] If the file exists and is a special word file, it is true.[-D file] If the file exists and is a directory,
Here I want to talk about the parentheses, braces, and variables in several shells. The command usage is as follows:
1. $ {var}2. $ (CMD)3. () and {}4. $ {var:-string}, $ {var: + string}, $ {var: = string}, $ {var :? String}5. $ (exp ))6. $ (VAR %
Use of if in shell, shellif useCompare if in shellShell determines whether an array contains an element:Ary = (1 2 3)A = 2If [["$ {ary [@]}" = ~ "$ A"]; thenEcho "a in ary"ElseEcho "a not in ary"FiThe method to compare the two strings is as
Special variables in Shell
$0
File Name of the current script
$ N
N is a number starting from 1. $1 represents the first parameter, $2 represents the second parameter, and $ {10} represents the tenth parameter.
Conditions test statement and Shell condition test statement in Shell
Shell has conditional test statements. Generally, the test or [] commands are used to complete the test. They are conditional judgment statements if ~ The basis of the then
Solution: show only-bash-4.1 in shell command line # Do not show users and pathsToday, I accidentally typed the home Directory deletion command. Although it was not deleted for various reasons, many files and directories in the home directory were
Password Change in non-interactive mode in Shell scriptsToday, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is obviously not good in the script, So I went online to search
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.