Small shell _mysql Select Connection Query

Select Connection Query Brief:Union Union Query Second, about the internal connection Union Union Query Function: Merge 2 or more query results together Specific: (table 1 Query results) Union (table 2 query results) Run: The first table 1

Shell Backup Database

/bin/bashBakpath=/opt/mysqlMyuser=rootmypasswd=123456Socket=/data/3308/mysql.sockmycmd= "Mysql-u$myuser-p$mypasswd-s $SOCKET"Mysqldump=mysqldump-u$myuser-p$mypasswd-s $SOCKET-X-f-r[!-D $BAKPATH] && mkdir-p $BAKPATHDblist= ' $MYCMD-e "show databases;

Bash Shell parameter expansion

1 ${parameter%word} and ${parameter%%word}${parameter%word},word is a pattern that starts at the end of the parameter parameter and matches it forward. A single% makes the shortest match, that is, matches from the back forward, and encounters a

Whether the shell monitoring process exists

1. Direct to the code: I am this is two programs. Most likely to write a function[email protected] src]# cat checkprocess.sh#!/bin/bashCheckprocess (){Ps-ef|grep $1|grep-v grepIf [$?! = 0];thenSystemctl Start $Elseecho "It ' s

A common way for Shell to intercept strings

1, get the character from the front 8, the implementation method is as follows:a=123456789$ expr substr $a 1 8$ echo $a |cut-c 1-8echo $$ echo $a |dd Bs=1 count=8 2>/dev/null2. Interception by the specified string(1) The first method:A string after

Linux entry fourth day--shell basics

First, shell overview  1. Overviewcommand-line interpreter   (shell, which is our operating interface), the computer only knows 0101 binary, we need to use the ASCII table to translate  The more official explanation is:The shell is a program

HDU Shell Necklace CDQ Division +fft

Shell Necklaceproblem DescriptionPerhaps the sea ' s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling for my best lover Arrietty , but even that's not enough.Suppose

Linux Shell determines whether files and folders exist

#!/bin/sh mypath= "/var/log/httpd/" myfile= "/var/log/httpd/access.log" #这里的-x parameter Judging $ Whether the MyPath exists and has enforceable permissions if [!-X ' $myPath]; then mkdir "$myPath" fi #这里的-D parameter to determine if

Shell special variables and forward and backward task switching methods

Echo ' $ Get the file name of the currently executing shell script: ' $Echo ' $n gets the nth parameter value of the currently executing shell script: ' $ ' =$1 ' $ =$2 ' $ ' =$3Echo ' $* gets all the parameters of the currently executing shell

Special variables for the Shell

2017-08-021.$0 gets the name or full path of the current scriptCat Name.shlinux Shellsh Name.shecho $0name.sh2. $n (n >=1) get the script nth parameter note the usage of n>9 ${n}Example: SH name.sh aa bb cc dd EEecho $ $4 $ ${20}Output: AA bb cc dd

Shell Match single quotation mark

Https://stackoverflow.com/questions/91110/how-to-match-a-single-quote-in-sedToday is looking at an example of sed '/larry\ 's ' Larry. The results are not matched. Google is not aware of the query. Matching single quotation marks cannot be simply

Bulk change read and write permissions for all files under a file using the Terminal shell command

The previously installed directory on OpenFire encountered this problem, and today again. You need to change all subdirectories below a directory and the three permissions of the file: the user reads and writes. The administrator reads and writes.

Shell exercises (1)

(1) Please follow the date format (XXXX-XX-XX) to generate a daily file, such as the file generated today is 2017-07-05.log, and the use of the disk to write to this file, (do not consider Cron, just write the script can be)!#! /bin/bashd= ' Date

Add a column to a file using a shell script

My college classmates asked me a script question, presumably the need is to see all the ports open, but also to know the application path of each port, and to be flush with the previous data, is to add a column of data. I butt eyes, very easy, but

Linux shell renders data

Input/Output Display on the monitorRedirect to FileStandard file descriptor0 STDIN Standard Input1 STDOUT Standard output2 STDERR standard error redirect error message when you need to develop a file descriptor Ls-al badfile 2> test11111Ls-al

Common shell commands

1. See if a program is running ps–ef|greptomcat 查看所有有关tomcat的进程 2. Terminating a thread kill-9 2222  3. View files, including hidden files ls-al 4.

Positional variables and special variables in the shell

$$the PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?end code of the last Run command (return value)$-flag at a glance using the SET command$*all parameter lists. such as "$*" in the Case of "" ", in the

How to encrypt shell scripts without affecting script execution

Method One: SHCSHC is a tool for encrypting shell scripts. Its role is to convert the shell script into an executable binary file.SHC InstallationYum-y Install SHCHow to use:Shc-r-F script-name Note: To have the-r option, the-F followed by the name

Shell Scripting Encryption

Think of a long time not updated blog, today in the group to see the discussion about shell script encryption things.Think about it too, we are writing scripts sometimes configure the relevant account and password things, so as long as the

Shell script commands (logging)

1. Renaming filesRename the A.txt under the D drive to B.txtMV D:\\a.txt D:\\b.txt2. deleting filesDelete the A.txt file under D driveRM d:\\a.txt3. Modify the contents of the file and saveGet the A.txt content under the D driveoldtime=$ (Cat

Total Pages: 541 1 .... 446 447 448 449 450 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.