Shell script Backup Database (docu)

bz2

#!/bin/bashPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbinExport PATH#数据库用户名Dbuser= ' Root '#数据库用密码dbpasswd= ' Password '#需要备份的数据库, multiple databases are separated by spacesDbname= (' dbname1 ' dbname2 ' dbname3 ' dbname4 ' dbname5

First shell Script--Modify configuration file

There is demand, can let oneself lazy is the real motive force of study. Because the test environment always needs to manually modify the configuration file after building the code, the learning side completes a shell script that can be modified

Common commands for the shell

SortHandle sorting problems.For example: Sort-r/file the rows of file in descending order.Tr:As a simplified version of SED, you can replace another character with one character, or delete some characters.CutSplitting according to the line of the

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

Numerical conversion in the shell

Octal (020) →10[[email protected] yemo]# echo $ ((num=020)) 16[[email protected] yemo]# echo $ ((num=8#20)) 16Hex (0xff) →10[[email protected] yemo]# echo $ ((NUM=0XFF)) 255[[email protected] yemo]# echo $ ((NUM=16#FF)) 255[[email protected] yemo]#

Shell definition variable Pits

Debugdir="/debugexamples "Releasedir="/releaseexamples "Docdir="../../../Mew_devdata/Interfacedoc/" forPathinch' ls ' doifTest-d $path ThenEcho'Test Package'$path cd $path./test.sh CD. RM-r $docDir $path$debugdir RM-R $docDir $path$releasedir CP-r

Linux Shell Code

1#! /bin/Bash2 3#/python2292/cnedmp/etlscript/cnedmp_etl_v1.0/Testhis4load_path=$ (CD $ (dirname$0);pwd)5#/python2292/cnedmp/etlscript/cnedmp_etl_v1.06deploy_path=$ (CD $ (dirname$LOAD _path);pwd)7#/python2292/cnedmp/Etlscript8base_path=$ (CD"$

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

View the currently supported shell

/etc/shells more/etc/shells/bin/sh/bin/bash/sbin/nologin/usr/bin/sh/ usr/bin/bash/usr/sbin/nologin/bin/tcsh/bin/cshECHO-E Related escape character\ \ input \\a Output Warning tone\b Backspace, i.e. delete one character to the left\c Remove line

Shell Script sed tool

Overview of the SED tools (streaming editor)Non-interactive, filter and modify text based on pattern matchingLine by row and output the results to the screencan achieve the output of the text, increase, delete, change, check and other operationsSed

Name of the shell-3-file

1. Generate files of any sizeif=/dev/zero of=junk.data bs=1m count=1recorded 1+0 read- inrecorded the writing of 1+0.1048576 bytes (1.0 MB) copied,0.00219263 sec,478 MB / secIf represents the input file, The of is the output file,the BS size,

Shell Exercises (2)

(1)Monitoring 80 Ports Write a script to determine whether the 80 port of the machine is open, if you do not do anything, if you find that the port does not exist, then restart the httpd service, the concurrent mail notify yourself. Once the script

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

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

Linux-shell Programming (I.)

Shell Programming Script ProgrammingCompilers, interpretersProgramming languages: Machine language, assembly language, advanced languagesStatic language: Compiled languageStrongly typed (variable)Convert into executable format in advanceC, C + +,

Shell programming for Linux Select and case usage

Select usage in the shell:Grammar:#i/bin/bashselect variable in list do you want to execute statement doneExample:#!/bin/bashecho "What is your favourite OS?" Select Var in "Windows" "Linux" "Gnu Hurd" "Free BSD" "Other";d O-echo "You had selected

An array of shell primer (iv)

One or one-D arraysBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.Similar to the C language, the subscript of an array element is numbered starting with 0.Second, define the

Shell sort and two-fork tree sort

Shell sort#include using namespacestd;voidPrint (int*list,intlen);voidShellsort (int*list,int*list2,intLenintgap);voidShellsort (int*list,int*list2,intLenintGap) {intCC = Len/gap + (len%gap! =0);intL =0; for(inti =0; I ) { for(intc =0; C ) {

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

Use X-shell on win10 to connect to Ubuntu in a virtual machine

1. In Ubuntu, install SSH:sudo apt-get update # to complete system updatescd/etc/init.d/# See if SSH service is installedsudo apt-get install Openssh-server # for installationsudo etc/init.d/ssh Restart # Restart service, others are:

Total Pages: 541 1 .... 520 521 522 523 524 .... 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.