Shell script to back up the database

#!/bin/bash#back_mysql by 2016-11-14bak_dir=/data/backup_db/' Date +%y%m%d 'Mysqldb=mysqlmysqluser=*****mysqlpw=******If [$UID-ne 0];thenecho "must to being use as root for exec shell"ExitFi#判断是否存在文件, \033[32m is the color of the displayif [!-D $bak

Shell Syntax format

Shell Syntax formatIf statementIf conditionThenCommand sequenceFiIf conditionThenCommand sequenceElseCommand sequenceFiIf conditionThenCommand sequenceElif conditionsThenCommand sequenceElif conditionsThenCommand sequenceElseCommand

Partition script in "Shell" Linux

The day after tomorrow to reply, today only brush a question, have not written out, but want to update the blog, so only to write the previous things posted out.A shell script for partitioning1 #!/bin/Bash #指定脚本解释器路径 2 echo "Initial a disk ..." 3

Bash Shell analog Password input

function inpasswd {Read-s-P "Enter you Password:" Passwd1EchoRead-s-P "please Check Password" passwd2Echoif [[$passwd 1 = = $passwd 2]]Thenecho "correct" && exit 1Elseecho "Incorrect"echo "Please Input Agin"Fi}Count=1While TrueDoIf [$count-GT

Shell script Bulk Modify file name

Before modifying the file name#!/bin/bask#for A in $ (ls/etc/yum.repos.d/centos*);d oif [$a! = '/etc/yum.repos.d/centos-media.repo '];then #CentO The S-media.repo file name does not modify the MV $a $a. bak

Write a shell every day.

1. Read basic reading 1 #!/bin/bash 2 #testing the Read command 3 4 Echo " Enter you name: " 5 Read name # 6echo"Hello $name, Welcome to my program. " Perform:#./read. SH Enter

Linux Shell Text filtering

Regular Expression - concept: A special syntax for describing text patterns -by ordinary characters (e.g., characters A to Z), and special characters (metacharacters, such as/ *?). And so on) make up a matching string--the text Filter tool supports

Shell script, the begin explanation in awk.

Explain:begin{} The most common use of this particular pattern is variable assignment. Begin this pattern is when the file does not begin to read.awk ' begin{fs= ': "; ofs="-"}{nf+=0}1", corresponding processing is 1:2:3---------> read the input

Shell script Application (i) case

Case One• Write a login welcome script for ROOT to report the number of processes in the current host, the number of logged-in users, and the disk usage of the root file system.1. Using the VIM command in the /root directory is a new script file

The grep command for Shell programming

grep formatgrep [Options] [mode] [file ...]-C outputs only the number of matching rows-n Lists all matching rows and displays line numbers-V Displays all lines that do not contain matching text-R Recursive Search-E supports extended regular

Shell script in the background execute commands &

Recently encountered a problem,Execute script, script calls a command, command (Deamon) is a daemon, in order to debug, the daemon mode is canceled. The other commands behind the command (echo "456") cannot be executed.Deamon-d is initiated in

Interception of Shell strings

directly on the code.1linux- About:/Install#Cat 3.SH 2#!/bin/SH3Str=HelloWorld4 Echo 'STR = ='$STR5 6 Echo${STR:5:5} # ==Echo${STR:5} #结果为World7 Echo${STR:5} # Use: ${str:begin:len} #结果为World 8 9 ExprSubstr"$STR" 6 5 #结果为World Ten One Echo$STR |awk

Qualified Linux OPS personnel will be the 30-channel shell programming surface questions and explanations

Super depth of the shell advanced programming practice, as of the current Shell programming courses in the domestic training institutions The most fine courses, do not believe in the level of students to see the performance. course cows are not

Shell script, insert "|" between every 5 characters, do not insert "|" At the end of the line.

TextAaaaabbbbbcccccddddeeeeefffffkkkkkvvvvnnnnngggggThe following results are expected:aaaaa|bbbbb|ccccc| ddddeeeee|fffff|kkkkk| VVVVNNNNN|GGGGGMatch requirements: You want to insert a "|" between every 5 characters, and if the number of characters

Case and function of shell programming

I. Overview of CASE statementsUse case statements to rewrite if multiple branches to make the script structure clearer and more hierarchicalPerform different command sequences for different values of variablesThe case statement is structured as

Shell Programming Learning 2--Command Daquan

There are a number of commands in Linux that can be divided into 10 categories (see [1]): 1) file management; 2) document editing; 3) file transfer; 4) Disk Management; 5) disk maintenance; 6) network communication; 7) system management; 8) system

HBase Shell Basic Command Summary

Accessing HBase, and manipulating hbase, commands do not use semicolonsHBase Shell enters HBaseList View TableHBase shell-dHBase (main):024:0> scan '. META. '============= Small Example ===================================================1. Create a

Bash Shell array variables

First, define the array variable1. Grammar(1) arrayname= (parameter1 parameter2 ...)Example 1, define an array named name, with a value of Claire,obama,georgeName= (Claire Obama )(2) Arrayname= (Parameter1Parameter2...)Again we change example 1 to

Java invokes shell commands and scripts dedicated to Hadoop/spark clusters

ObjectiveNote that this blog post is based on the following blog posts, based on them, dedicated to my big data

Empty Shell Mail

Empty Shell end:Vim/etc/named.rfc1912.zonescd/var/named/cp-p westos.com.zone Westos.org.zoneVim Westos.orf.zone650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/4C/wKiom1hJAw3QQXmuAABg2u1TR8g913.png-wh_500x0-wm_3 -wmp_4-s_254782645.png

Total Pages: 541 1 .... 528 529 530 531 532 .... 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.