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;

Shell exercises 21 files show content three lines as one line

Requirement: One file displays the content three line as a lineIdea: is the second line of content, the contents of the third row is appended to the first row, so that the contents of three lines can become a row, if not enough three lines

Shell Script Management Disk

Scripting features: Display all disks and select, partition all selected disks, repartition partitions and format file system#!/bin/bash# Display all disks and select, format partition of selected disk, repartition partition and format file

Several methods of implementing Linux shell calls under QT

Using Qprocess Qthread============================================#include int main (){Qprocess::execute ("LS");return 0;}============================================ Qprocess *poc = new Qprocess;poc-> Start ("Ping 222.207

Some uses of shell grep

#1, total number of statistical characters#统计系统中不允许登录的用户数Grep-c ' Nologin '/etc/passwd#2, case-insensitive lookup of all lines of the specified character;Grep-i ' Good ' 9.txt#3, print the line and line number of the specified character;Grep-n "Good"

Shell instance Practice + detailed

Thinking of comparing the shell to a script like Python and Java, I gave up when I had the idea. This is too insulting to the shell. (Crying smiley!) )As a programmer, Linux is the most basic requirement. and the shell script will sometimes show its

A comparison of integers in the shell

-eq equals, such as: if ["$a"-eq "$b"]-ne not equal to, such as: if ["$a"-ne "$b"]-GT greater than, such as: if ["$a"-gt "$b"]-ge greater than equals, such as: if ["$a"-ge "$b"]-lt less than, such as: if ["$a"-lt "$b"]-le less than equals, such as:

The shell file contains

Create a two shell script file. The test1.sh code is as follows:#!/bin/bashurl= "Http://www.cnblogs.com/freescience"The test2.sh code is as follows:#!/bin/bash# use. To reference the test1.sh file. ./test1.sh# or use the following include file code #

Linux shell built-in judgment

Built-in judgment, when successful returns 0, does not successfully return nonzeroTest-judging expression[Judgment expression] Note must be left blank before and afterNumeric operations-eq equals-ne Not equal to-GT Greater than-ge greater than or

Shell Script Combat

Want to write a script, found that all forget, egg pain, while recalling the side of the writing, finally finished, affixed to the following:1#!/bin/Bash2 #Program:3 # can help you quickly redeploy the project4 #History:5# ./ ,/TenShichaogeng First

Shell Scripting Encryption

#shc是一个专业的加密shell脚本的工具. Its role is to convert the shell script into an executable binary file, which is a good solution to the script contains IP, password and so do not want to open the problem.HTTP://WWW.DATSI.FI.UPM.ES/~FROSAL/SOURCES/SHC's

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

A production shell script

#!/bin/bash#created: 2017.07.21#author: molewan#description: help erp app  upgrade ########################################################## #脚本说明 ################################## ######################### #a, copy the data that needs to be added

Some tips for getting a shell

Turn from: Some tips for getting a shell1. Upload asp asa jsp cer PHP aspx format of the Trojan, do not add a space or use IIS6.0 Parsing vulnerability, common format: 1.asp;1.jpg or 1.asp;. JPG or 1.asp;jpg2. Sometimes upload the image format of

Linux Shell simple script to modify IP

Tag: Shell Modify IP #!/bin/bash#2017-7-13#by ip_file=/etc/sysconfig/network-scripts/ifcfg-eth0zt= ' grep  "static"   $IP _file|wc -l ' bf_file=/data/ifcfg-eth/' date  "+%y_%m_%d" '/ipaddr= "192.168.25.107" netmask= "255.255.255.0 "Getaway=" 192.168

Shell script Programming

BASH: Weakly typed languageVariable type:Environment variables, local variables (local variables), positional variables, special variables1. Local variables: Only valid in the current process, parent-child shell is not universalDeclarative method:

The shell must have 30 questions.

1. Batch generation of random character filenamesUse the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy, with the following name

Shell script-Simple Add user

Description: Adds a user name and password through a script, and discards the add if the user name already existsScript Name: test2.txtCd/optlsmkdir SHELLLSCD SHELLLSVI Test2.txtThe script reads as follows:#!/bin/bashid $ &>/dev/null && echo "User $

Sort-shell Sort

In the insert sort, all elements are compared to the previous element, and the position is replaced. So the number of exchanges is the square level of N. In extreme cases, if the smallest element is on the far right, you need to displace each and

Shell scripting language Usage

Shell program run:1./xx.sh. Running the shell this way requires the shell program to have executable permissions. chmod a+x xx.sh to add executable permissions.2, Source xx.sh.3. Bash Xx.sh,bash is a script interpreter, which is essentially an

Total Pages: 541 1 .... 535 536 537 538 539 .... 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.